Skip to content

Commit

Permalink
Revert "Lint: Tell users that backslashes are no longer necessary aft…
Browse files Browse the repository at this point in the history
…er => & |" (#6492)
  • Loading branch information
wxtim authored Nov 25, 2024
1 parent 5bf2b1c commit dc962a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 30 deletions.
1 change: 0 additions & 1 deletion changes.d/6459.feat.md

This file was deleted.

14 changes: 1 addition & 13 deletions cylc/flow/scripts/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,7 @@ def list_wrapper(line: str, check: Callable) -> Optional[Dict[str, str]]:
'S013': {
'short': 'Items should be indented in 4 space blocks.',
FUNCTION: check_indentation
},
'S014': {
'short': (
'`=>` implies line continuation without `\\`'
),
FUNCTION: re.compile(r'=>\s*\\').findall
},
}
}
# Subset of deprecations which are tricky (impossible?) to scrape from the
# upgrader.
Expand Down Expand Up @@ -721,12 +715,6 @@ def list_wrapper(line: str, check: Callable) -> Optional[Dict[str, str]]:
FUNCTION: functools.partial(
list_wrapper, check=CHECK_FOR_OLD_VARS.findall),
},
'U017': {
'short': (
'`&` and `|` imply line continuation without `\\`'
),
FUNCTION: re.compile(r'[&|]\s*\\').findall
},
}
ALL_RULESETS = ['728', 'style', 'all']
EXTRA_TOML_VALIDATION = {
Expand Down
21 changes: 5 additions & 16 deletions tests/unit/scripts/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
STYLE_CHECKS = parse_checks(['style'])
UPG_CHECKS = parse_checks(['728'])

TEST_FILE = '''
TEST_FILE = """
[visualization]
[cylc]
Expand Down Expand Up @@ -97,13 +97,7 @@
hold after point = 20220101T0000Z
[[dependencies]]
[[[R1]]]
graph = """
MyFaM:finish-all => remote => !mash_theme
a & \\
b => c
c | \\
d => e
"""
graph = MyFaM:finish-all => remote => !mash_theme
[runtime]
[[root]]
Expand Down Expand Up @@ -160,10 +154,10 @@
host = `rose host-select thingy`
%include foo.cylc
'''
"""


LINT_TEST_FILE = '''
LINT_TEST_FILE = """
\t[scheduler]
[scheduler]
Expand All @@ -173,11 +167,6 @@
{% foo %}
{{foo}}
# {{quix}}
R1 = """
foo & \\
bar => \\
baz
"""
[runtime]
[[this_is_ok]]
Expand All @@ -191,7 +180,7 @@
platform = $(some-script foo)
[[baz]]
platform = `no backticks`
''' + (
""" + (
'\nscript = the quick brown fox jumps over the lazy dog until it becomes '
'clear that this line is longer than the default 130 character limit.'
)
Expand Down

0 comments on commit dc962a1

Please sign in to comment.