-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Milestone
Description
#4900 has gone beyond a basic sed
file and is now the basis for a more generic linter 🎉.
Some follow-on ideas:
Editor integration:
(See #5014)
7 to 8 migration rules
This linter could be a highly valuable tool in the 7->8 upgrade. Also include a couple of Python 2->3 pointers.
- Missing shebang
- If Jinja2 or EmPy syntax is detected in the
suite.rc
orflow.cylc
file and the first line of the file is not a matching shebang. - (
rose suite-run
used to tolerate missing shebang lines)
- If Jinja2 or EmPy syntax is detected in the
- Module name changes
cylc
->cylc.flow
rose
->metomi.rose
isodatetime
->metomi.isodatetime
- In Python files
from _ import
andimport _
. - In
.cylc
&.rc
filesfrom "_" import
- Tabs in Python files (e.g. Jinja2 filters)
- Use spaces to indent Python 3 files, mix of tabs and spaces is a syntax error.
- Zero-prefixed integers in
.cylc
,.rc
files.- E.G.
05
rather than5
, previously accepted, now a Jinja2 syntax error.
- E.G.
- Suicide triggers
- No longer needed, use optional outputs (for
.cylc
files only).
- No longer needed, use optional outputs (for
- platform = $(rose host-select)
- Advise using built-in host selection via configured platforms rather than
$(rose host-select)
. - Note there may be legit reasons to use subshells here (platforms does not offer a
filter
interface yet). - But
rose host-select
is definitely unnecessary.
- Advise using built-in host selection via configured platforms rather than
- Deprecated env vars (all files in project).
- Check for deprecated commands (documented in
cylc.flow.scripts.cylc.DEAD_ENDS
). - Parameter simplification
<x><y>
is valid but can be simplified<x, y>
- See Support expanding
<param1><param2>
in inherited family names #5537
- Deprecated task and workflow event template variables
- e.g.
%(suite)
= Feat.lint obsolete vars #5879
- e.g.
- Use of
rose suite-hook
(command removed at Rose 2) -
CYLC_VERSION={{CYLC_VERSION}}
(same forROSE_
andFCM_
). lint: Warn users thatCYLC_VERSION={{CYLC_VERSION}}
is deprecated #5890 - Using
cylc workflow-state
in a task-script, should use theworkflow_state
xtrigger instead -
:expired
output must be optional if used (also:expire
,:expire-all
and:expire-any
), see optional output extension proposal.
Additional style rules and bug bears
- ...
Pull requests welcome!
hjoliver