diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index fe312a1..767a378 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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/ \ No newline at end of file + run: ruff check newCAM_emulation/ + \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..086021b --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 + \ No newline at end of file