Skip to content

Commit bb8ed49

Browse files
committed
README: Add info on chaining and configuration
1 parent 42f6487 commit bb8ed49

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

README.org

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Regardless of where you installed solidity mode from, you need to require the pa
3232

3333
** Interface with linters
3434
*** Provide path to solc binary
35-
The ~solc~ binary is assumed to be part of the PATH. Wherever that is not the case you would have to manually
35+
The =solc= binary is assumed to be part of the PATH. Wherever that is not the case you would have to manually
3636
set the location of the binary like below:
3737
#+BEGIN_SRC emacs-lisp
3838
(setq solidity-solc-path "/home/lefteris/ew/cpp-ethereum/build/solc/solc")
@@ -41,7 +41,7 @@ set the location of the binary like below:
4141
Note: This better be set before requiring solidity mode.
4242

4343
*** Provide path to solium binary
44-
The ~solium~ binary is assumed to be part of the user's ~PATH~. If this is not the case
44+
The =solium= binary is assumed to be part of the user's =PATH=. If this is not the case
4545
then set its location like below:
4646
#+BEGIN_SRC emacs-lisp
4747
(setq solidity-solium-path "/home/lefteris/.npm-global/bin/solium")
@@ -53,19 +53,24 @@ Solidity mode can also interface with [[https://github.com/flycheck/flycheck][fl
5353
download and install the flycheck package. Then configure it to either work on
5454
all modes or enable it only for solidity mode.
5555

56-
Flycheck can interface either with solc or with [[http://solium.readthedocs.io/en/latest/][solium]]. Choose the appropriate
57-
linter to use by providing the following in your emacs init:
56+
Flycheck can interface with solc and/or with [[http://solium.readthedocs.io/en/latest/][solium]]. You have to specifically set the path
57+
to both executables and activate the checker integration by setting the following:
5858

59+
To activate =solc= checker
5960
#+BEGIN_SRC emacs-lisp
60-
(setq solidity-flycheck-active-checker "solium")
61+
(setq solidity-flycheck-solc-checker-active t)
62+
#+END_SRC
63+
64+
To activate =solium= checker
65+
#+BEGIN_SRC emacs-lisp
66+
(setq solidity-flycheck-solium-checker-active t)
6167
#+END_SRC
6268

63-
If you want to use ~"solc"~ replace ~"solium"~ with it.
6469

6570
Keep in mind that you need to provide the path to either solc or solium unless
66-
emacs can already find it in your environment's ~PATH~. Even if you can call it
71+
emacs can already find it in your environment's =PATH=. Even if you can call it
6772
from the command line it does not mean that EMACS can see it as emacs may be started
68-
by systemd at which point ~PATH~ is not fully populated.
73+
by systemd at which point =PATH= is not fully populated.
6974

7075
*** Configuring solc checker
7176

@@ -82,13 +87,19 @@ By default this is false. If you want to include the standard contracts just add
8287
You can configure flycheck's solium incocation with the following arguments
8388

8489
**** solium RC file
85-
By default solium looks at the current directory of the file you are editing in order to find ~.soliumrc.json~. Having this
90+
By default solium looks at the current directory of the file you are editing in order to find =.soliumrc.json=. Having this
8691
file is required. But you can point to an external configuration file by putting the following anywhere in your emacs init file.
8792

8893
#+BEGIN_SRC emacs-lisp
8994
(setq flycheck-solidity-solium-soliumrcfile "/home/path/to/common/.soliumrc.json")
9095
#+END_SRC
9196

97+
*** Chaining both checkers
98+
If you enable both checkers then their results are chained. The variable =solidity-flycheck-chaining-error-level= controls
99+
how they are chained. Its value can be either =t=, =error=, =warning= or =info= and that controls the maximum error level
100+
of the solc checker after which solium will not run. If =t= is given solium will always run. The default is =warning=, so
101+
if anything over than a warning is found in solc solium will not run.
102+
92103
* Features
93104
+ Syntax highlighting
94105
+ Indentation

0 commit comments

Comments
 (0)