Skip to content

Commit d59680f

Browse files
wxtimMetRonnie
andauthored
pyproject.toml: cylc lint settings (#531)
document cylc lint toml file Co-authored-by: Ronnie Dutta <[email protected]>
1 parent 4c627c2 commit d59680f

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

src/dictionaries/words

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ retriggered
139139
retriggering
140140
roadmap
141141
routines
142+
ruleset
143+
rulesets
142144
runahead
143145
runnable
144146
runtime

src/user-guide/writing-workflows/configuration.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,49 @@ show an inlined copy of the workflow with correct line numbers.
149149

150150
.. automodule:: cylc.flow.scripts.lint
151151

152+
Configure ``cylc lint`` at project level
153+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154+
155+
You can configure ``cylc lint`` for each workflow using a
156+
``pyproject.toml`` file.
157+
158+
To define settings for ``cylc lint`` use a ``[cylc-lint]`` section.
159+
Within the ``[cylc-lint]`` section you may define the following:
160+
161+
rulesets
162+
A list of rulesets to use. If you run cylc lint without setting rulesets
163+
on the command line this value will override
164+
the default (``['728', 'style']``).
165+
166+
Allowed Values: '728', 'style'
167+
168+
ignore
169+
Individual rules to ignore: A list of rule codes, such as ``S007``.
170+
171+
exclude
172+
A list of files or glob patterns for files which will not be checked.
173+
174+
max-line-length
175+
Set longest line length to permit in Cylc Configs for this project.
176+
If unset, line length is not checked.
177+
178+
179+
An example ``pyproject.toml`` might look like this:
180+
181+
.. code-block:: toml
182+
183+
[cylc-lint]
184+
# Enforce a line limit of 99 chars
185+
max-line-length = 99
186+
187+
# Ignore style [S] rule 007 (It's good practice comment with a reason)
188+
ignore = ['S007'] # Family names start with lowercase in this workflow
189+
190+
# Don't check files matching these globs
191+
exclude = ['history/*.old.cylc', 'someother.cylc']
192+
193+
# By default check for style
194+
rulesets = ['style']
195+
196+
[some-other-section]
197+
# Cylc lint won't pay any attention to this.

0 commit comments

Comments
 (0)