Browse Source

Removing deprecated linter settings and simplify the input

Juan Blanco 4 months ago
parent
commit
59f3e14d58
4 changed files with 15 additions and 27 deletions
  1. 12 17
      package.json
  2. 1 1
      src/linter/solhint.ts
  3. 1 1
      src/linter/solium.ts
  4. 1 8
      src/server.ts

+ 12 - 17
package.json

@@ -10,7 +10,7 @@
     "nethereum",
     "solhint"
   ],
-  "version": "0.0.74",
+  "version": "0.0.75",
   "publisher": "JuanBlanco",
   "engines": {
     "vscode": "^1.30.0"
@@ -60,10 +60,10 @@
     "mkdirp": "^0.5.1",
     "nethereum-codegen": "^1.0.12",
     "prettier": "^2.0.2",
-    "prettier-plugin-solidity": "1.0.0-alpha.54",
+    "prettier-plugin-solidity": "1.0.0-alpha.55",
     "require-from-string": "^2.0.2",
-    "solc": "^0.6.9",
-    "solhint": "^3.0.0",
+    "solc": "^0.7.0",
+    "solhint": "^3.1.0",
     "solium": "^1.2.5",
     "solparse": "^2.2.8",
     "vscode-languageclient": "^5.2.1",
@@ -118,12 +118,14 @@
           "description": "Compile using a local solc binary file, please include the path of the file if wanted: 'C://v0.4.3+commit.2353da71.js'"
         },
         "solidity.linter": {
-          "type": [
-            "boolean",
-            "string"
+          "type": "string",
+          "enum": [
+            "",
+            "solhint",
+            "solium"
           ],
-          "default": "solium",
-          "description": "Enables solhint linting. Possible options 'solhint' and 'solium'"
+          "default": "solhint",
+          "description": "Enables linting using either solium (ethlint) or solhint. Possible options 'solhint' and 'solium', the default is solhint"
         },
         "solidity.solhintRules": {
           "type": [
@@ -141,13 +143,6 @@
           ],
           "description": "Enables / disables the solidity formatter (prettier solidity default)"
         },
-        "solidity.enabledSolium": {
-          "type": [
-            "boolean"
-          ],
-          "default": false,
-          "description": "Enables solium linting. DEPRECATED: Use \"linter\" instead"
-        },
         "solidity.soliumRules": {
           "type": [
             "object"
@@ -183,7 +178,7 @@
         },
         "solidity.packageDefaultDependenciesContractsDirectory": {
           "type": "string",
-          "default": "contracts",
+          "default": "",
           "description": "Default directory where the Package Dependency store its contracts, i.e: 'src', 'contracts', or just a blank string '', this is used to avoid typing imports with subfolder paths"
         }
       }

+ 1 - 1
src/linter/solhint.ts

@@ -23,7 +23,7 @@ export default class SolhintService implements Linter {
 
     private toDiagnostic(error) {
         return {
-            message: `${error.message} [${error.ruleId}]`,
+            message: `Linter: ${error.message} [${error.ruleId}]`,
             range: this.rangeOf(error),
             severity: this.severity(error),
         };

+ 1 - 1
src/linter/solium.ts

@@ -103,7 +103,7 @@ export default class SoliumService implements Linter {
         const line = lintResult.line - 1;
 
         return {
-            message: `${lintResult.ruleName}: ${lintResult.message}`,
+            message: `Linter: ${lintResult.ruleName}: ${lintResult.message}`,
             range: {
                 end: {
                     character: lintResult.node.end,

+ 1 - 8
src/server.ts

@@ -24,7 +24,6 @@ interface Settings {
 
 interface SoliditySettings {
     // option for backward compatibilities, please use "linter" option instead
-    enabledSolium: boolean;
     linter: boolean | string;
     enabledAsYouTypeCompilationErrorCheck: boolean;
     compileUsingLocalVersion: string;
@@ -277,13 +276,7 @@ connection.onDidChangeConfiguration((change) => {
 });
 
 function linterName(settings: SoliditySettings) {
-    const enabledSolium = settings.enabledSolium;
-
-    if (enabledSolium) {
-        return 'solium';
-    } else {
-        return settings.linter;
-    }
+     return settings.linter;
 }
 
 function linterRules(settings: SoliditySettings) {