| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 200fe9e commit 0fb0406
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1565,8 +1565,8 @@ cpplint: lint-cpp | |||
| 1565 | 1565 | # Try with '--system' if it fails without; the system may have set '--user' | |
| 1566 | 1566 | lint-py-build: ## Build resources needed to lint python files. | |
| 1567 | 1567 | $(info Pip installing ruff on $(shell $(PYTHON) --version)...) | |
| 1568 | - $(PYTHON) -m pip install --upgrade --target tools/pip/site-packages ruff==0.6.5 || \ | ||
| 1569 | - $(PYTHON) -m pip install --upgrade --system --target tools/pip/site-packages ruff==0.6.5 | ||
| 1568 | + $(PYTHON) -m pip install --upgrade --target tools/pip/site-packages ruff==0.13.1 || \ | ||
| 1569 | + $(PYTHON) -m pip install --upgrade --system --target tools/pip/site-packages ruff==0.13.1 | ||
| 1570 | 1570 | ||
| 1571 | 1571 | .PHONY: lint-py lint-py-fix lint-py-fix-unsafe | |
| 1572 | 1572 | ifneq ("","$(wildcard tools/pip/site-packages/ruff)") | |
@@ -1576,7 +1576,6 @@ lint-py: | |||
| 1576 | 1576 | tools/pip/site-packages/bin/ruff check . | |
| 1577 | 1577 | lint-py-fix: | |
| 1578 | 1578 | tools/pip/site-packages/bin/ruff check . --fix | |
| 1579 | - | ||
| 1580 | 1579 | lint-py-fix-unsafe: | |
| 1581 | 1580 | tools/pip/site-packages/bin/ruff check . --fix --unsafe-fixes | |
| 1582 | 1581 | else | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1300,7 +1300,7 @@ def check_compiler(o): | |||
| 1300 | 1300 | print_verbose(f"Detected {'Apple ' if is_apple else ''}{'clang ' if is_clang else ''}C++ compiler (CXX={CXX}) version: {version_str}") | |
| 1301 | 1301 | if not ok: | |
| 1302 | 1302 | warn(f'failed to autodetect C++ compiler version (CXX={CXX})') | |
| 1303 | - elif (is_apple and clang_version < (17, 0, 0) or not is_apple and clang_version < (19, 1, 0)) if is_clang else gcc_version < (12, 2, 0): | ||
| 1303 | + elif ((is_apple and clang_version < (17, 0, 0)) or (not is_apple and clang_version < (19, 1, 0))) if is_clang else gcc_version < (12, 2, 0): | ||
| 1304 | 1304 | warn(f"C++ compiler (CXX={CXX}, {version_str}) too old, need g++ 12.2.0 or clang++ 19.1.0{' or Apple clang++ 17.0.0' if is_apple else ''}") | |
| 1305 | 1305 | ||
| 1306 | 1306 | ok, is_clang, clang_version, gcc_version, is_apple = try_check_compiler(CC, 'c') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,11 +11,13 @@ target-version = "py39" | |||
| 11 | 11 | ||
| 12 | 12 | [tool.ruff.lint] | |
| 13 | 13 | select = [ | |
| 14 | + "ASYNC", # flake8-async | ||
| 14 | 15 | "C90", # McCabe cyclomatic complexity | |
| 15 | 16 | "E", # pycodestyle | |
| 16 | 17 | "F", # Pyflakes | |
| 17 | 18 | "ICN", # flake8-import-conventions | |
| 18 | 19 | "INT", # flake8-gettext | |
| 20 | + "PERF", # flake8-performance | ||
| 19 | 21 | "PLC", # Pylint conventions | |
| 20 | 22 | "PLE", # Pylint errors | |
| 21 | 23 | "PLR09", # Pylint refactoring: max-args, max-branches, max returns, max-statements | |
@@ -32,6 +34,7 @@ ignore = [ | |||
| 32 | 34 | "E401", | |
| 33 | 35 | "E402", | |
| 34 | 36 | "E7", | |
| 37 | + "PLC0415", | ||
| 35 | 38 | "RUF005", | |
| 36 | 39 | ] | |
| 37 | 40 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -160,9 +160,7 @@ def SelectTest(name): | |||
| 160 | 160 | result = [] | |
| 161 | 161 | for subpath in os.listdir(path): | |
| 162 | 162 | if os.path.isdir(os.path.join(path, subpath)): | |
| 163 | - for f in os.listdir(os.path.join(path, subpath)): | ||
| 164 | - if SelectTest(f): | ||
| 165 | - result.append([subpath, f[:-3]]) | ||
| 163 | + result.extend([subpath, f[:-3]] for f in os.listdir(os.path.join(path, subpath)) if SelectTest(f)) | ||
| 166 | 164 | return result | |
| 167 | 165 | ||
| 168 | 166 | def ListTests(self, current_path, path, arch, mode): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,7 +28,7 @@ class CheckImportsTest(unittest.TestCase): | |||
| 28 | 28 | 'test', 'fixtures', 'tools', 'checkimports') | |
| 29 | 29 | ||
| 30 | 30 | def test_unused_and_unsorted(self): | |
| 31 | - with captured_output() as (out, err): | ||
| 31 | + with captured_output() as (out, _err): | ||
| 32 | 32 | self.assertEqual(is_valid(path.join(self.fixturesDir, 'invalid.cc')), | |
| 33 | 33 | False) | |
| 34 | 34 | output = out.getvalue() | |
@@ -42,21 +42,21 @@ def test_unused_and_unsorted(self): | |||
| 42 | 42 | output); | |
| 43 | 43 | ||
| 44 | 44 | def test_unused_complex(self): | |
| 45 | - with captured_output() as (out, err): | ||
| 45 | + with captured_output() as (out, _err): | ||
| 46 | 46 | self.assertEqual(is_valid(path.join(self.fixturesDir, 'maybe.cc')), | |
| 47 | 47 | False) | |
| 48 | 48 | output = out.getvalue() | |
| 49 | 49 | self.assertIn('does not use "Local"', output); | |
| 50 | 50 | ||
| 51 | 51 | def test_unused_simple(self): | |
| 52 | - with captured_output() as (out, err): | ||
| 52 | + with captured_output() as (out, _err): | ||
| 53 | 53 | self.assertEqual(is_valid(path.join(self.fixturesDir, 'unused.cc')), | |
| 54 | 54 | False) | |
| 55 | 55 | output = out.getvalue() | |
| 56 | 56 | self.assertIn('does not use "Context"', output); | |
| 57 | 57 | ||
| 58 | 58 | def test_unsorted(self): | |
| 59 | - with captured_output() as (out, err): | ||
| 59 | + with captured_output() as (out, _err): | ||
| 60 | 60 | self.assertEqual(is_valid(path.join(self.fixturesDir, 'unsorted.cc')), | |
| 61 | 61 | False) | |
| 62 | 62 | output = out.getvalue() | |
@@ -67,7 +67,7 @@ def test_unsorted(self): | |||
| 67 | 67 | output); | |
| 68 | 68 | ||
| 69 | 69 | def test_valid(self): | |
| 70 | - with captured_output() as (out, err): | ||
| 70 | + with captured_output() as (out, _err): | ||
| 71 | 71 | self.assertEqual(is_valid(path.join(self.fixturesDir, 'valid.cc')), | |
| 72 | 72 | True) | |
| 73 | 73 | output = out.getvalue() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,7 +95,7 @@ def main(): | |||
| 95 | 95 | default='//node') | |
| 96 | 96 | parser.add_argument('--dep-file', help='path to an optional dep file', | |
| 97 | 97 | default=None) | |
| 98 | - args, unknown_args = parser.parse_known_args() | ||
| 98 | + args, _unknown_args = parser.parse_known_args() | ||
| 99 | 99 | ||
| 100 | 100 | config = get_gn_config(args.out_dir) | |
| 101 | 101 | v8_config = get_v8_config(args.out_dir, args.node_gn_path) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -339,17 +339,17 @@ def removeList(count=0): | |||
| 339 | 339 | removeList(1) | |
| 340 | 340 | ||
| 341 | 341 | # now, fixup res_index, one at a time | |
| 342 | - for tree in trees: | ||
| 342 | + for tree, value in trees.items(): | ||
| 343 | 343 | # skip trees that don't have res_index | |
| 344 | - if "hasIndex" not in trees[tree]: | ||
| 344 | + if "hasIndex" not in value: | ||
| 345 | 345 | continue | |
| 346 | 346 | treebunddir = options.tmpdir | |
| 347 | - if(trees[tree]["treeprefix"]): | ||
| 348 | - treebunddir = os.path.join(treebunddir, trees[tree]["treeprefix"]) | ||
| 347 | + if(value["treeprefix"]): | ||
| 348 | + treebunddir = os.path.join(treebunddir, value["treeprefix"]) | ||
| 349 | 349 | if not (os.path.isdir(treebunddir)): | |
| 350 | 350 | os.mkdir(treebunddir) | |
| 351 | 351 | treebundres = os.path.join(treebunddir,RES_INDX) | |
| 352 | 352 | treebundtxt = "%s.txt" % (treebundres[0:-4]) | |
| 353 | 353 | runcmd("iculslocs", "-i %s -N %s -T %s -b %s" % (outfile, dataname, tree, treebundtxt)) | |
| 354 | 354 | runcmd("genrb","-d %s -s %s res_index.txt" % (treebunddir, treebunddir)) | |
| 355 | - runcmd("icupkg","-s %s -a %s%s %s" % (options.tmpdir, trees[tree]["treeprefix"], RES_INDX, outfile)) | ||
| 355 | + runcmd("icupkg","-s %s -a %s%s %s" % (options.tmpdir, value["treeprefix"], RES_INDX, outfile)) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,7 +73,7 @@ def try_copy(options, path, dest): | |||
| 73 | 73 | return shutil.copy2(source_path, target_path) | |
| 74 | 74 | ||
| 75 | 75 | def try_remove(options, path, dest): | |
| 76 | - source_path, target_path = mkpaths(options, path, dest) | ||
| 76 | + _source_path, target_path = mkpaths(options, path, dest) | ||
| 77 | 77 | if not options.silent: | |
| 78 | 78 | print('removing %s' % target_path) | |
| 79 | 79 | try_unlink(target_path) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -817,7 +817,7 @@ def setResourceLimits(): | |||
| 817 | 817 | else: | |
| 818 | 818 | preexec_fn = setMaxVirtualMemory | |
| 819 | 819 | ||
| 820 | - (process, exit_code, timed_out) = RunProcess( | ||
| 820 | + (_process, exit_code, timed_out) = RunProcess( | ||
| 821 | 821 | context, | |
| 822 | 822 | timeout, | |
| 823 | 823 | args = args, | |
@@ -924,7 +924,7 @@ def GetBuildRequirements(self, path, context): | |||
| 924 | 924 | return result | |
| 925 | 925 | ||
| 926 | 926 | def ListTests(self, current_path, path, context, arch, mode): | |
| 927 | - (name, rest) = CarCdr(path) | ||
| 927 | + (name, _rest) = CarCdr(path) | ||
| 928 | 928 | result = [ ] | |
| 929 | 929 | for test in self.tests_repos: | |
| 930 | 930 | test_name = test.GetName() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments