Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a pre-commit-config file #24

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,26 @@ jobs:
runs-on: ubuntu-latest

steps:
#Checkout Code
- uses: actions/checkout@v4

#Set up Python
- uses: actions/setup-python@v5
with:
python-version: "3.12"

#Install dependencies
- name: Install dependencies
run: pip install .[lint]

#Check code formatting with ruff
# annotate each step with `if: always` to run all regardless
- name: Check code formatting with ruff
if: always()
run: ruff format --diff newCAM_emulation/

#Lint with ruff using pyproject.toml configuration
- name: Lint with ruff using pyproject.toml configuration
if: always()
run: ruff check newCAM_emulation/
run: ruff check newCAM_emulation/

7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.0
hooks:
- id: ruff
args: [--fix] # This will auto-fix issues if possible

Loading