mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add lint for backticks in shell scripts
The "$(some_command arg1 arg2)" form is preferred to the `some_command arg1 arg2` form because it nests unambiguously. Add a lint for this to tidy.
This commit is contained in:
parent
4bc629b369
commit
79ef9b4efc
5 changed files with 24 additions and 14 deletions
|
@ -52,6 +52,7 @@ class CheckTidiness(unittest.TestCase):
|
|||
errors = tidy.collect_errors_for_files(iterFile('shell_tidy.sh'), [], [tidy.check_shell], print_text=False)
|
||||
self.assertEqual('script does not have shebang "#!/usr/bin/env bash"', errors.next()[2])
|
||||
self.assertEqual('script is missing options "set -o errexit", "set -o pipefail"', errors.next()[2])
|
||||
self.assertEqual('script should not use backticks for command substitution', errors.next()[2])
|
||||
self.assertNoMoreErrors(errors)
|
||||
|
||||
def test_rust(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue