Skip to content

Commit

Permalink
CI: Adding CI check for linted files. If a PR is open with code that …
Browse files Browse the repository at this point in the history
…is not compliant with the linters, it will fail this status check. Please see comments in workflow or docs/setup.md for how to ensure your linters are installed and running on commit (#4)

bugfix: Known issue in pre-commit with not found python interpreter, changing language version in precommit config file to reflect python version used for CI

CI check: This commit should fail the CI linter check as it's not ruff-compliant

CI: Undoing the demonstration for the CI linter check
  • Loading branch information
JuLieAlgebra authored Feb 15, 2024
1 parent a3fdd3f commit 58ddf3d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/linter_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Code Style Check
# If your code has failed this workflow, you need to install the pre-commit hooks and run `pixi run pre-commit run --all-files`, adding and committing those changes.
# Please see docs/setup.md for more information on installing and what the committing process looks like.

on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize

env:
PYTHON_VERSION: "3.10"

jobs:
Check-linter-status:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit hooks
run: pre-commit run --all-files --show-diff-on-failure
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.11
language_version: python3.10
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
Expand Down

0 comments on commit 58ddf3d

Please sign in to comment.