From bdf92f6c3368aa46f725767ef6d668b1ffcaa36a Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Thu, 21 Mar 2024 10:10:23 +0200 Subject: [PATCH] Upgrade CI + lint tools (#745) * Upgrade Ruff, use it for formatting too * Upgrade GitHub Actions --- .github/workflows/test.yml | 8 ++++---- .pre-commit-config.yaml | 13 ++++--------- pyproject.toml | 2 ++ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40602d7..8bf7c03 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,14 +12,14 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: pre-commit/action@v3.0.0 + - uses: actions/checkout@v4 + - uses: pre-commit/action@v3.0.1 test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" cache: "pip" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f961c5..d558162 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,15 @@ repos: - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.259 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.3.3 hooks: - id: ruff args: - --fix + - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: end-of-file-fixer exclude: ^collections/.* - id: trailing-whitespace exclude: ^collections/.* - - repo: https://github.com/psf/black - rev: 23.1.0 - hooks: - - id: black - args: - - --quiet diff --git a/pyproject.toml b/pyproject.toml index 207411a..9a2169c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,8 @@ markers = [ [tool.ruff] target-version = "py310" + +[tool.ruff.lint] select = [ "B", "C",