| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1536,17 +1536,22 @@ cpplint: lint-cpp | |||
| 1536 | 1536 | # Try with '--system' if it fails without; the system may have set '--user' | |
| 1537 | 1537 | lint-py-build: | |
| 1538 | 1538 | $(info Pip installing ruff on $(shell $(PYTHON) --version)...) | |
| 1539 | - $(PYTHON) -m pip install --upgrade --target tools/pip/site-packages ruff==0.5.2 || \ | ||
| 1540 | - $(PYTHON) -m pip install --upgrade --system --target tools/pip/site-packages ruff==0.5.2 | ||
| 1539 | + $(PYTHON) -m pip install --upgrade --target tools/pip/site-packages ruff==0.6.5 || \ | ||
| 1540 | + $(PYTHON) -m pip install --upgrade --system --target tools/pip/site-packages ruff==0.6.5 | ||
| 1541 | 1541 | ||
| 1542 | - .PHONY: lint-py | ||
| 1542 | + .PHONY: lint-py lint-py-fix lint-py-fix-unsafe | ||
| 1543 | 1543 | ifneq ("","$(wildcard tools/pip/site-packages/ruff)") | |
| 1544 | 1544 | # Lint the Python code with ruff. | |
| 1545 | 1545 | lint-py: | |
| 1546 | 1546 | $(info Running Python linter...) | |
| 1547 | 1547 | tools/pip/site-packages/bin/ruff check . | |
| 1548 | + lint-py-fix: | ||
| 1549 | + tools/pip/site-packages/bin/ruff check . --fix | ||
| 1550 | + | ||
| 1551 | + lint-py-fix-unsafe: | ||
| 1552 | + tools/pip/site-packages/bin/ruff check . --fix --unsafe-fixes | ||
| 1548 | 1553 | else | |
| 1549 | - lint-py: | ||
| 1554 | + lint-py lint-py-fix lint-py-fix-unsafe: | ||
| 1550 | 1555 | $(warning Python linting with ruff is not available) | |
| 1551 | 1556 | $(warning Run 'make lint-py-build') | |
| 1552 | 1557 | endif | |
@@ -1604,6 +1609,7 @@ lint-clean: | |||
| 1604 | 1609 | $(RM) tools/.*lintstamp | |
| 1605 | 1610 | $(RM) .eslintcache | |
| 1606 | 1611 | $(RM) -r tools/eslint/node_modules | |
| 1612 | + $(RM) tools/pip/site_packages | ||
| 1607 | 1613 | ||
| 1608 | 1614 | HAS_DOCKER ?= $(shell command -v docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0) | |
| 1609 | 1615 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ | |||
| 34 | 34 | import utils | |
| 35 | 35 | import signal | |
| 36 | 36 | import sys | |
| 37 | - import xml.etree.ElementTree as xml | ||
| 37 | + import xml.etree.ElementTree as ET | ||
| 38 | 38 | ||
| 39 | 39 | def IsExitCodeCrashing(exit_code): | |
| 40 | 40 | if utils.IsWindows(): | |
@@ -44,22 +44,22 @@ def IsExitCodeCrashing(exit_code): | |||
| 44 | 44 | ||
| 45 | 45 | class JUnitTestOutput: | |
| 46 | 46 | def __init__(self, test_suite_name): | |
| 47 | - self.root = xml.Element("testsuite") | ||
| 47 | + self.root = ET.Element("testsuite") | ||
| 48 | 48 | self.root.attrib["name"] = test_suite_name | |
| 49 | 49 | ||
| 50 | 50 | def HasRunTest(self, test_name, test_cmd, test_duration, test_failure): | |
| 51 | - test_case_element = xml.Element("testcase") | ||
| 51 | + test_case_element = ET.Element("testcase") | ||
| 52 | 52 | test_case_element.attrib["name"] = test_name | |
| 53 | 53 | test_case_element.attrib["cmd"] = test_cmd | |
| 54 | 54 | test_case_element.attrib["time"] = str(round(test_duration, 3)) | |
| 55 | 55 | if test_failure is not None: | |
| 56 | - failure_element = xml.Element("failure") | ||
| 56 | + failure_element = ET.Element("failure") | ||
| 57 | 57 | failure_element.text = test_failure | |
| 58 | 58 | test_case_element.append(failure_element) | |
| 59 | 59 | self.root.append(test_case_element) | |
| 60 | 60 | ||
| 61 | 61 | def FinishAndWrite(self, f): | |
| 62 | - xml.ElementTree(self.root).write(f, "UTF-8") | ||
| 62 | + ET.ElementTree(self.root).write(f, "UTF-8") | ||
| 63 | 63 | ||
| 64 | 64 | ||
| 65 | 65 | def Main(): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments