diff --git a/.editorconfig b/.editorconfig index 0f4d99d0f..e55d13f9d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,7 @@ indent_size = 4 max_line_length = 120 # Same as .clang-format [*.py] -max_line_length = 88 # Same as Black +max_line_length = 88 # Same as Ruff's default [*.md] trim_trailing_whitespace = false diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4816d046a..9309054aa 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -13,3 +13,6 @@ # 2024-05-28 formatted c++ source with clang-format 637448f8252ab142eedd539ddf9b08259b73eecc + +# 2024-10-14 formatted Python source with Ruff format +2b5191d8fc6f1d1fbde01481b49278c1957ef8f1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6356b0e36..2275d01cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -110,25 +110,24 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - # This job only needs to target the oldest version supported by our checkers - # (black>=24.10.0 supports Python >=3.9) - python-version: "3.9" + # This job only needs to target the oldest supported version + python-version: "3.8" cache: pip cache-dependency-path: .github/workflows/main.yml - run: pip install clang-format==18.* pycln - run: pycln . --config=pycln.toml --check - uses: astral-sh/ruff-action@v1 with: - version: "0.4.5" - - uses: psf/black@stable + version: "0.4.9" + - uses: astral-sh/ruff-action@v1 with: - options: "--fast --check --diff --verbose" + version: "0.4.9" + args: "format --check" - run: | # Too many files to fit in a single command, also exclude vendored Scintilla and MAPIStubLibrary clang-format --Werror --dry-run $(git ls-files '*.cpp' ':!:com/win32comext/mapi/src/MAPIStubLibrary/') if ($LastExitCode -ne 0) { exit $LastExitCode } clang-format --Werror --dry-run $(git ls-files '*.h' ':!:Pythonwin/Scintilla/' ':!:com/win32comext/mapi/src/MAPIStubLibrary/') if ($LastExitCode -ne 0) { exit $LastExitCode } - shell: powershell mypy: runs-on: windows-2019 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aa634c7f2..a2f2eff96 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,11 +29,7 @@ repos: hooks: - id: ruff # Run the linter. args: [--fix] - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 - hooks: - - id: black - verbose: true + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-clang-format rev: v18.1.8 hooks: diff --git a/AutoDuck/Dump2HHC.py b/AutoDuck/Dump2HHC.py index 343bdbca1..32c728c9d 100644 --- a/AutoDuck/Dump2HHC.py +++ b/AutoDuck/Dump2HHC.py @@ -293,9 +293,7 @@ def _genItemsFromDict(dict, cat, output, target, do_children=1): - """.format( - **locals() - ) + """.format(**locals()) ) if not do_children: continue @@ -339,9 +337,7 @@ def genTOC(cats, output, title, target):