Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyproject.toml: cylc lint settings #531

Merged
merged 3 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.