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