Skip to content

Commit 8a29da3

Browse files
committed
Add soliumrc config file option
1 parent 458763d commit 8a29da3

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

solidity-mode.el

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ Highlight the 1st result."
460460
(defvar flycheck-solidity-checker-executable)
461461
(defvar flycheck-solium-checker-executable)
462462

463-
(flycheck-def-option-var flycheck-solidity-addstd-contracts nil solidity-checker
463+
(flycheck-def-option-var flycheck-solidity-solc-addstd-contracts nil solidity-checker
464464
"Whether to add standard solidity contracts.
465465
466466
When non-nil, enable add also standard solidity contracts via
@@ -469,14 +469,25 @@ When non-nil, enable add also standard solidity contracts via
469469
:safe #'booleanp
470470
:package-version '(solidity-mode . "0.1.3"))
471471

472+
(flycheck-def-option-var flycheck-solidity-solium-soliumrcfile nil solium-check
473+
"The path to use for soliumrc.json
474+
475+
The value of this variable is either a string denoting a path to the soliumrc.json
476+
or nil, to use the current directory. When non-nil,
477+
we pass the directory to solium via the `--config' option."
478+
:type '(choice (const :tag "No custom soliumrc" nil)
479+
(string :tag "Custom soliumrc file location"))
480+
:safe #'stringp
481+
:package-version '(solidity-mode . "0.1.4"))
482+
472483
;; add dummy source-inplace definition to avoid errors
473484
(defvar source-inplace t)
474485
;; add a solidity mode callback to set the executable of solc for flycheck
475486
;; define solidity's flycheck syntax checker
476487
(flycheck-define-checker solidity-checker
477488
"A Solidity syntax checker using the solc compiler"
478489
:command ("solc"
479-
(option-flag "--add-std" flycheck-solidity-addstd-contracts)
490+
(option-flag "--add-std" flycheck-solidity-solc-addstd-contracts)
480491
source-inplace)
481492
:error-patterns
482493
((error line-start (file-name) ":" line ":" column ":" " Error: " (message))
@@ -488,7 +499,10 @@ When non-nil, enable add also standard solidity contracts via
488499
;; define solium flycheck syntax checker
489500
(flycheck-define-checker solium-checker
490501
"A Solidity linter using solium"
491-
:command ("solium" "-f" source-inplace)
502+
:command ("solium"
503+
(option "--config=" flycheck-solidity-solium-soliumrcfile concat)
504+
"-f"
505+
source-inplace)
492506
:error-patterns
493507
((error line-start (zero-or-more " ") line ":" column (zero-or-more " ") "error" (message))
494508
(warning line-start (zero-or-more " ") line ":" column (zero-or-more " ") "warning" (message)))

0 commit comments

Comments
 (0)