mirror of https://github.com/zulip/zulip.git
lint: Convert sudo exclusion to double quotes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
07efcf61d4
commit
1a4f70f1bc
|
@ -457,7 +457,7 @@ def is_root() -> bool:
|
|||
def run_as_root(args: List[str], **kwargs: Any) -> None:
|
||||
sudo_args = kwargs.pop('sudo_args', [])
|
||||
if not is_root():
|
||||
args = ['sudo', *sudo_args, '--', *args]
|
||||
args = ["sudo", *sudo_args, "--", *args]
|
||||
run(args, **kwargs)
|
||||
|
||||
def assert_not_running_as_root() -> None:
|
||||
|
|
|
@ -244,12 +244,11 @@ python_rules = RuleList(
|
|||
'description': 'Unnecessary whitespace between "," and ")"',
|
||||
'good_lines': ['foo = (1, 2, 3,)', 'foo(bar, 42)'],
|
||||
'bad_lines': ['foo = (1, 2, 3, )']},
|
||||
{'pattern': 'sudo',
|
||||
{'pattern': r'\bsudo\b',
|
||||
'include_only': {'scripts/'},
|
||||
'exclude': {'scripts/lib/setup_venv.py'},
|
||||
'exclude_line': {
|
||||
('scripts/lib/zulip_tools.py', 'sudo_args = kwargs.pop(\'sudo_args\', [])'),
|
||||
('scripts/lib/zulip_tools.py', 'args = [\'sudo\', *sudo_args, \'--\', *args]'),
|
||||
('scripts/lib/zulip_tools.py', 'args = ["sudo", *sudo_args, "--", *args]'),
|
||||
},
|
||||
'description': 'Most scripts are intended to run on systems without sudo.',
|
||||
'good_lines': ['subprocess.check_call(["ls"])'],
|
||||
|
|
Loading…
Reference in New Issue