|
125 | 125 | 'url': STYLE_GUIDE + 'trailing-whitespace',
|
126 | 126 | 'index': 6
|
127 | 127 | },
|
128 |
| - re.compile(r'inherit\s*=\s*[a-z].*$'): { |
| 128 | + # Look for families both from inherit=FAMILY and FAMILY:trigger-all/any |
| 129 | + re.compile(r'(inherit\s*=\s*.*[a-z].*)|(\w[a-z]\w:\w+?-a(ll|ny))'): { |
129 | 130 | 'short': 'Family name contains lowercase characters.',
|
130 | 131 | 'url': STYLE_GUIDE + 'task-naming-conventions',
|
131 | 132 | 'index': 7
|
132 | 133 | },
|
| 134 | + re.compile(r'{[{%]'): { |
| 135 | + 'short': JINJA2_FOUND_WITHOUT_SHEBANG, |
| 136 | + 'url': '', |
| 137 | + 'index': 8 |
| 138 | + }, |
| 139 | + re.compile(r'platform\s*=\s*\$\(.*?\)'): { |
| 140 | + 'short': 'Host Selection Script may be redundant with platform', |
| 141 | + 'url': ( |
| 142 | + 'https://cylc.github.io/cylc-doc/stable/html/7-to-8/' |
| 143 | + 'major-changes/platforms.html' |
| 144 | + ), |
| 145 | + 'index': 9 |
| 146 | + }, |
| 147 | + re.compile(r'platform\s*=\s*(`.*?`)'): { |
| 148 | + 'short': 'Using backticks to invoke subshell is deprecated', |
| 149 | + 'url': 'https://github.com/cylc/cylc-flow/issues/3825', |
| 150 | + 'index': 10 |
| 151 | + }, |
| 152 | + re.compile(r'#.*?{[{%]'): { |
| 153 | + 'short': 'Cylc will process commented Jinja2!', |
| 154 | + 'url': '', |
| 155 | + 'index': 11 |
| 156 | + } |
133 | 157 | # re.compile(r'^.{{maxlen},}'): {
|
134 | 158 | # 'short': 'line > {maxlen} characters.',
|
135 | 159 | # 'url': STYLE_GUIDE + 'line-length-and-continuation',
|
|
170 | 194 | '``global.cylc[platforms][<platform name>]job runner``'
|
171 | 195 | )
|
172 | 196 | },
|
| 197 | + re.compile(r'host\s*=\s*(`.*?`)'): { |
| 198 | + 'short': 'Using backticks to invoke subshell will fail at Cylc 8.', |
| 199 | + 'url': 'https://github.com/cylc/cylc-flow/issues/3825' |
| 200 | + } |
173 | 201 | }
|
174 | 202 | RULESETS = ['728', 'style', 'all']
|
175 | 203 | EXTRA_TOML_VALIDATION = {
|
@@ -464,7 +492,16 @@ def check_cylc_file(
|
464 | 492 | ):
|
465 | 493 | continue
|
466 | 494 |
|
467 |
| - if check.findall(line) and not line.strip().startswith('#'): |
| 495 | + if ( |
| 496 | + check.findall(line) |
| 497 | + and ( |
| 498 | + not line.strip().startswith('#') |
| 499 | + or ( |
| 500 | + 'commented Jinja2!' in message['short'] |
| 501 | + and check.findall(line) |
| 502 | + ) |
| 503 | + ) |
| 504 | + ): |
468 | 505 | count += 1
|
469 | 506 | if modify:
|
470 | 507 | if message['url'].startswith('http'):
|
|
0 commit comments