From a7d82e23dfb20cd669d365a9582ef84d84d62962 Mon Sep 17 00:00:00 2001 From: Trevor Bergeron Date: Wed, 5 Mar 2025 23:37:28 +0000 Subject: [PATCH 1/4] chore: Add mypy github action --- .github/sync-repo-settings.yaml | 1 + .github/workflows/mypy.yml | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/mypy.yml diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index c2f3673fcc..37874a6888 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -12,6 +12,7 @@ branchProtectionRules: - 'cla/google' - 'docs' - 'lint' + - 'mypy' - 'unit (3.9)' - 'unit (3.10)' - 'unit (3.11)' diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml new file mode 100644 index 0000000000..e6a79291d0 --- /dev/null +++ b/.github/workflows/mypy.yml @@ -0,0 +1,22 @@ +on: + pull_request: + branches: + - main +name: mypy +jobs: + mypy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run mypy + run: | + nox -s mypy From 825f00210bcc5992683f6548414a4f58799e2351 Mon Sep 17 00:00:00 2001 From: Trevor Bergeron Date: Thu, 6 Mar 2025 00:14:56 +0000 Subject: [PATCH 2/4] add format action --- .github/sync-repo-settings.yaml | 1 + .github/workflows/format.yml | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 37874a6888..a0b239ce53 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -12,6 +12,7 @@ branchProtectionRules: - 'cla/google' - 'docs' - 'lint' + - 'format' - 'mypy' - 'unit (3.9)' - 'unit (3.10)' diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000000..7d821d3ed5 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,22 @@ +on: + pull_request: + branches: + - main +name: format +jobs: + format: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run format + run: | + nox -s format From 86b568e587985bef58be53ad3ce74223dd171c41 Mon Sep 17 00:00:00 2001 From: Trevor Bergeron Date: Fri, 7 Mar 2025 02:22:36 +0000 Subject: [PATCH 3/4] integrate isort into lint nox session --- .github/sync-repo-settings.yaml | 1 - noxfile.py | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index a0b239ce53..37874a6888 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -12,7 +12,6 @@ branchProtectionRules: - 'cla/google' - 'docs' - 'lint' - - 'format' - 'mypy' - 'unit (3.9)' - 'unit (3.10)' diff --git a/noxfile.py b/noxfile.py index ca147e171d..c1b8e6f155 100644 --- a/noxfile.py +++ b/noxfile.py @@ -139,7 +139,12 @@ def lint(session): Returns a failure if the linters find linting errors or sufficiently serious code quality issues. """ - session.install("flake8", BLACK_VERSION) + session.install("flake8", BLACK_VERSION, ISORT_VERSION) + session.run( + "isort", + "--check", + *LINT_PATHS, + ) session.run( "black", "--check", From 680c4ae1c0a63ad0cacddcfb6f55e011f8bcb791 Mon Sep 17 00:00:00 2001 From: Trevor Bergeron Date: Wed, 12 Mar 2025 17:31:47 +0000 Subject: [PATCH 4/4] remove format.yml --- .github/workflows/format.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index 7d821d3ed5..0000000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,22 +0,0 @@ -on: - pull_request: - branches: - - main -name: format -jobs: - format: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - name: Install nox - run: | - python -m pip install --upgrade setuptools pip wheel - python -m pip install nox - - name: Run format - run: | - nox -s format