Skip to content

Commit f8c2a6c

Browse files
feat: replace super-linter with pre-commit (#88)
BREAKING CHANGE: replace super-linter with pre-commit Co-authored-by: uoboda-splunk <uoboda@splunk.com>
1 parent 01c4397 commit f8c2a6c

File tree

6 files changed

+14
-35
lines changed

6 files changed

+14
-35
lines changed

.github/workflows/reusable-build-test-release.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,22 +141,13 @@ jobs:
141141

142142
lint:
143143
runs-on: ubuntu-latest
144-
name: quality-lint
145144
steps:
146145
- uses: actions/checkout@v3
146+
- uses: actions/setup-python@v4
147147
with:
148-
# Full git history is needed to get a proper list of changed files within `super-linter`
149-
fetch-depth: 0
150-
- name: quality-lint
151-
uses: docker://ghcr.io/github/super-linter:slim-v4.9.4
152-
env:
153-
VALIDATE_ALL_CODEBASE: false
154-
DEFAULT_BRANCH: main
155-
LINTER_RULES_PATH: /
156-
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
157-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
158-
FILTER_REGEX_EXCLUDE: README.md
159-
VALIDATE_GITHUB_ACTIONS: false
148+
python-version: "3.7"
149+
- uses: pre-commit/action@v3.0.0
150+
160151
review_secrets:
161152
name: security-detect-secrets
162153
runs-on: ubuntu-latest

README.md

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -163,44 +163,32 @@ i.e <img src="images/compliance-copyrights/license.png" alt="license" style="wid
163163
- No additional Artifacts.
164164
165165
166-
quality-lint
167-
============
166+
lint
167+
====
168168
169169
**Description:**
170170
171-
- It is a simple combination of various linters, written in bash, to help validate your source code.
171+
- Workflow <2.0.0 used [super-linter](https://github.com/github/super-linter) to lint the code, which we don't use anymore now
172172
173-
**Action used** https://github.com/github/super-linter
173+
- Uses [pre-commit](https://pre-commit.com) to run linters (Python, Java, JS and others)
174+
175+
**Action used** https://github.com/pre-commit/action
174176
175177
**Pass/fail behaviour:**
176178
177179
- If the stage detects a linting error in the code the stage would fail with error information.
178180
179-
**Exception file**
180-
181-
- Since this action uses multiple linters there might be errors from multiple linters as well
182-
183-
- If there is a flake8 failure we can use .flake8 file and similarly for other linters as well, However its not necessary each linter will have its own ignore file.
184-
185181
**Troubleshooting steps for failures if any**
186182
187-
- User can look through the details for failures in logs and browse how to resolve a specific linters error i.e for flake8 failures one in install flake8 in local env and fix the failures and push to the repository.
188-
189-
- Summary:<br />
190-
<img src="images/quality-lint/summary.png" alt="summary" style="width:200px;"/>
191-
<br />
192-
- Specific Error in logs: <br />
193-
<img src="images/quality-lint/error.png" alt="error" style="width:200px;"/> <br />
194-
- Summary for multiple lint failures: <br />
195-
<img src="images/quality-lint/summary2.png" alt="summary2" style="width:200px;"/>
183+
- User can install `pre-commit` locally and run all the linters locally (`pre-commit run --all-files`) and resolve all the issues without the necessity to test changes in the CI.
196184
185+
- User can look through the details for failures in logs and browse how to resolve a specific linters error i.e for flake8 failures one in install flake8 in local env and fix the failures and push to the repository.
197186
198-
- If the logs are too long to display User can also access raw logs and search for issues. <br />
199-
<img src="images/quality-lint/raw-logs.png" alt="raw-logs" style="width:200px;"/>
187+
- If your add-on has some Java code, you need to have Java installed locally, so Java linter will work.
200188
201189
**Artifacts:**
202190
203-
- No additional artifacts, Failure details are available in the logs.
191+
- No additional artifacts, failure details are available in the logs.
204192
205193
206194
security-detect-secrets

images/quality-lint/error.png

-832 KB
Binary file not shown.

images/quality-lint/raw-logs.png

-331 KB
Binary file not shown.

images/quality-lint/summary.png

-930 KB
Binary file not shown.

images/quality-lint/summary2.png

-1020 KB
Binary file not shown.

0 commit comments

Comments
 (0)