Skip to content

Commit

Permalink
pyproject.toml: cylc lint settings (#531)
Browse files Browse the repository at this point in the history
document cylc lint toml file

Co-authored-by: Ronnie Dutta <[email protected]>
  • Loading branch information
wxtim and MetRonnie authored Sep 12, 2022
1 parent 4c627c2 commit d59680f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dictionaries/words
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ retriggered
retriggering
roadmap
routines
ruleset
rulesets
runahead
runnable
runtime
Expand Down
46 changes: 46 additions & 0 deletions src/user-guide/writing-workflows/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,49 @@ show an inlined copy of the workflow with correct line numbers.

.. automodule:: cylc.flow.scripts.lint

Configure ``cylc lint`` at project level
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can configure ``cylc lint`` for each workflow using a
``pyproject.toml`` file.

To define settings for ``cylc lint`` use a ``[cylc-lint]`` section.
Within the ``[cylc-lint]`` section you may define the following:

rulesets
A list of rulesets to use. If you run cylc lint without setting rulesets
on the command line this value will override
the default (``['728', 'style']``).

Allowed Values: '728', 'style'

ignore
Individual rules to ignore: A list of rule codes, such as ``S007``.

exclude
A list of files or glob patterns for files which will not be checked.

max-line-length
Set longest line length to permit in Cylc Configs for this project.
If unset, line length is not checked.


An example ``pyproject.toml`` might look like this:

.. code-block:: toml
[cylc-lint]
# Enforce a line limit of 99 chars
max-line-length = 99
# Ignore style [S] rule 007 (It's good practice comment with a reason)
ignore = ['S007'] # Family names start with lowercase in this workflow
# Don't check files matching these globs
exclude = ['history/*.old.cylc', 'someother.cylc']
# By default check for style
rulesets = ['style']
[some-other-section]
# Cylc lint won't pay any attention to this.

0 comments on commit d59680f

Please sign in to comment.