From 514db60dbe5eade5deb8f7de31524e209be7b19c Mon Sep 17 00:00:00 2001 From: Surbhi Goel Date: Mon, 16 Sep 2024 15:12:00 +0100 Subject: [PATCH 1/5] Added a pre-commit-config file --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..785c9b2 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.1.0 # Use the latest version of the ruff-pre-commit repo + hooks: + - id: ruff + args: [--fix] # This will auto-fix issues if possible From a0c8a04cc9dce35f91e178b13113074584b4f4b7 Mon Sep 17 00:00:00 2001 From: Surbhi Goel Date: Mon, 16 Sep 2024 15:24:11 +0100 Subject: [PATCH 2/5] Added pre-commit step to lint.yaml file --- .github/workflows/lint.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index fe312a1..d9e13ee 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -14,17 +14,32 @@ 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] + pip install pre-commit + + #Run pre-commit hooks + - name: Run pre-commit hooks + run: | + pre-commit run --all-files + + #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 From 1f5486e80fe969c68d8d998f66bbf8226e527e0d Mon Sep 17 00:00:00 2001 From: Surbhi Goel Date: Mon, 16 Sep 2024 15:47:13 +0100 Subject: [PATCH 3/5] Added pre-commit hook --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 785c9b2..4e4d350 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.1.0 # Use the latest version of the ruff-pre-commit repo + rev: v0.1.0 hooks: - id: ruff args: [--fix] # This will auto-fix issues if possible From 8f5eab9384e6b05d8394d0f086e6b1b7869daac0 Mon Sep 17 00:00:00 2001 From: Surbhi Goel Date: Mon, 16 Sep 2024 15:50:00 +0100 Subject: [PATCH 4/5] Removed pre-commit hooks from lint.yaml --- .github/workflows/lint.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index d9e13ee..767a378 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -25,12 +25,6 @@ jobs: #Install dependencies - name: Install dependencies run: pip install .[lint] - pip install pre-commit - - #Run pre-commit hooks - - name: Run pre-commit hooks - run: | - pre-commit run --all-files #Check code formatting with ruff # annotate each step with `if: always` to run all regardless From d6c0f7ff8486071b7afede25ea94f7c020e3ab11 Mon Sep 17 00:00:00 2001 From: Surbhi Goel Date: Mon, 16 Sep 2024 15:50:31 +0100 Subject: [PATCH 5/5] Added pre-commit hook --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e4d350..086021b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,3 +4,4 @@ repos: hooks: - id: ruff args: [--fix] # This will auto-fix issues if possible + \ No newline at end of file