summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijayakumar A <36878324+kumvijaya@users.noreply.github.com>2024-09-04 10:12:44 +0530
committerGitHub <noreply@github.com>2024-09-04 10:12:44 +0530
commit8a241e2f5b2a371522cb7c1c840293eb9580c1d1 (patch)
treef907a61d3907dc17d5417214690911e1d6a1538d
parentca90f9690289bf1b2187e85ec7a64e2446de7f06 (diff)
parent7c14873dad7e6662ee4428fec3738c03a8be7d59 (diff)
downloadvyos-workflow-test-temp-8a241e2f5b2a371522cb7c1c840293eb9580c1d1.tar.gz
vyos-workflow-test-temp-8a241e2f5b2a371522cb7c1c840293eb9580c1d1.zip
Merge pull request #48 from kumvijaya/current
T0000: check
-rw-r--r--.github/workflows/darker-lint.yml24
-rw-r--r--ruff.toml18
2 files changed, 37 insertions, 5 deletions
diff --git a/.github/workflows/darker-lint.yml b/.github/workflows/darker-lint.yml
index f13d683..aea4666 100644
--- a/.github/workflows/darker-lint.yml
+++ b/.github/workflows/darker-lint.yml
@@ -11,7 +11,7 @@ permissions:
contents: read
jobs:
- darker-lint:
+ darker-ruff-lint:
runs-on: ubuntu-latest
permissions:
pull-requests: write
@@ -22,7 +22,7 @@ jobs:
with:
repository: vyos/.github
path: reusable-actions
- ref: feature/ruff-toml
+ ref: current
- name: Checkout head
uses: actions/checkout@v4
@@ -31,16 +31,30 @@ jobs:
fetch-tags: true
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
+ path: repo
- name: Fetch base
run: |
+ cd repo
git fetch https://github.com/${{ github.event.pull_request.base.repo.full_name }} ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/base
- - name: darker install
+ - name: Setup python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+
+ - name: Install darker ruff
run: |
pip install git+https://github.com/akaihola/darker.git@master ruff>=0.0.292
- name: Analyze Code
run: |
- ls -ltr
- darker -r origin/base --check --diff --lint "ruff check --config ./reusable-actions/.github/ruff.toml" --color . \ No newline at end of file
+ cd repo
+ if git ls-tree -r origin/base --name-only | grep -q '^ruff.toml$'; then
+ git checkout origin/base -- ruff.toml
+ echo "Using ruff.toml from base repo"
+ cat ruff.toml
+ else
+ echo "No ruff.toml found in base repo"
+ fi
+ darker -r origin/base --check --diff --lint "ruff check" --color . \ No newline at end of file
diff --git a/ruff.toml b/ruff.toml
new file mode 100644
index 0000000..2aaac4a
--- /dev/null
+++ b/ruff.toml
@@ -0,0 +1,18 @@
+# Same as Black.
+line-length = 100
+indent-width = 4
+
+# Assume Python 3.11
+target-version = "py311"
+
+[format]
+quote-style = "single"
+
+# Like Black, indent with spaces, rather than tabs.
+indent-style = "space"
+
+# Like Black, respect magic trailing commas.
+skip-magic-trailing-comma = false
+
+# Like Black, automatically detect the appropriate line ending.
+line-ending = "auto" \ No newline at end of file