-
Notifications
You must be signed in to change notification settings - Fork 94
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
Refactor.lint #5718
Refactor.lint #5718
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cylc-doc build error:
Warning, treated as error:
~/github/cylc-flow/cylc/flow/scripts/lint.py:docstring of cylc.flow.scripts.lint:10:Title underline too short.
`S001 <https://cylc.github.io/cylc-doc/stable/html/workflow-design-guide/style-guide.html#tab-characters>`_
^^^^
make: *** [html] Error 2
cf5159a
to
641ec46
Compare
Refactored get_reference_rst and get_reference_text into a single method. Actually use the URL in rst reference mode Added urls to CLI linter listing move extraneous stuff away from main func added type hinting and removed toml merging routines from the top level functions Move the logic for checking if the target is a Cylc 8 workflow to its own function. We want the target to be the top level folder, not the flow.cylc file
__doc__ += TOMLDOC.format( | ||
'\n\n.. code-block:: toml\n', str(LINT_SECTIONS)) + get_reference_rst( | ||
parse_checks(['728', 'style'], reference=True)) | ||
__doc__ += get_reference('all', 'rst') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be
__doc__ += TOMLDOC.format(
'\n\n.. code-block:: toml\n', str(LINT_SECTIONS)
) + get_reference('all', 'rst')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think not, this was what is currently causing cylc-doc build failures but your changes fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Will need a fix backported to 8.2.x)
…at_runtime * upstream/master: log_vc_info: handle long command output (cylc#5821) GH Actions: limit tutorial workflow to Py3.11 remove cylc task dependencies env var (cylc#5836) Refactor.lint (cylc#5718) protobuf 4.24.4 upgrade (cylc#5828) made reinstall work on multiple workflows Fix `IndepQueueManager` test (cylc#5832) Lint: Add a check for indentation being 4N spaces. (cylc#5772)
I did a review of my older code as a training exercise, and started refactoring.
get_reference_text
andget_reference_rst
.There's plenty more refactoring I'd like to do, but I really shouldn't be prioritizing this.
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.