Skip to content

Commit

Permalink
Merge pull request #264 from jrha/panlint_bind_length
Browse files Browse the repository at this point in the history
panlint: Ignore length of bind lines
  • Loading branch information
jrha authored Dec 2, 2024
2 parents 61f2ee4 + 9f392d4 commit 658cfe3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion panc/src/main/scripts/panlint/panlint.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def diagnose(self):
"Use dicts instead of nlists": re.compile(r'\b(?P<error>(?:is_)?nlist)\s*\('),
"Include statements no longer need curly braces": re.compile(r'''include\s+(?P<error>{[^;]+})'''),
"Line is longer than %s characters" % LINE_LENGTH_LIMIT:
re.compile(r'''^.{0,%s}(?P<error>.*?)$''' % LINE_LENGTH_LIMIT),
re.compile(r'''^(?!bind ).{0,%s}(?P<error>.*?)$''' % LINE_LENGTH_LIMIT),
"Commas should be followed by exactly one space": re.compile(r'(?P<error>,(?:\S|\s{2,}))'),
"Whitespace before semicolon": re.compile(r'(?P<error>\s+;)'),
"Semicolons should be followed exactly one space or end-of-line": re.compile(r';(?P<error>(?:\S|\s{2,}))'),
Expand Down
2 changes: 2 additions & 0 deletions panc/src/main/scripts/panlint/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ def test_check_line_patterns(self):
('error("is_asndate: invalid format for time");', []),
('debug(format("%s: bar: %s", OBJECT, ARGV[0]));', ['Redundant use of format within error or debug call']),
('debug("Foo" + bar + " has an unexpected format (should be a dict)");', []),
('"/software/components/metaconfig/services/{/etc/example_service_with_long_name/conf.d/dropin_config.cfg}/contents/foo" = "bar";', ['Line is longer than 120 characters']),
('bind "/software/components/metaconfig/services/{/etc/example_service_with_long_name/conf.d/dropin_config.cfg}/contents" = type_example_service;', []),
]

for text, messages in lines:
Expand Down

0 comments on commit 658cfe3

Please sign in to comment.