Skip to content

Commit

Permalink
feat: replace super-linter with pre-commit (#88)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: replace super-linter with pre-commit

Co-authored-by: uoboda-splunk <[email protected]>
  • Loading branch information
artemrys and uoboda-splunk authored Aug 12, 2022
1 parent 01c4397 commit f8c2a6c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 35 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/reusable-build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,13 @@ jobs:

lint:
runs-on: ubuntu-latest
name: quality-lint
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: quality-lint
uses: docker://ghcr.io/github/super-linter:slim-v4.9.4
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
LINTER_RULES_PATH: /
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
FILTER_REGEX_EXCLUDE: README.md
VALIDATE_GITHUB_ACTIONS: false
python-version: "3.7"
- uses: pre-commit/[email protected]

review_secrets:
name: security-detect-secrets
runs-on: ubuntu-latest
Expand Down
32 changes: 10 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,44 +163,32 @@ i.e <img src="images/compliance-copyrights/license.png" alt="license" style="wid
- No additional Artifacts.
quality-lint
============
lint
====
**Description:**
- It is a simple combination of various linters, written in bash, to help validate your source code.
- Workflow <2.0.0 used [super-linter](https://github.com/github/super-linter) to lint the code, which we don't use anymore now
**Action used** https://github.com/github/super-linter
- Uses [pre-commit](https://pre-commit.com) to run linters (Python, Java, JS and others)
**Action used** https://github.com/pre-commit/action
**Pass/fail behaviour:**
- If the stage detects a linting error in the code the stage would fail with error information.
**Exception file**
- Since this action uses multiple linters there might be errors from multiple linters as well
- 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.
**Troubleshooting steps for failures if any**
- 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.
- Summary:<br />
<img src="images/quality-lint/summary.png" alt="summary" style="width:200px;"/>
<br />
- Specific Error in logs: <br />
<img src="images/quality-lint/error.png" alt="error" style="width:200px;"/> <br />
- Summary for multiple lint failures: <br />
<img src="images/quality-lint/summary2.png" alt="summary2" style="width:200px;"/>
- 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.
- 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.
- If the logs are too long to display User can also access raw logs and search for issues. <br />
<img src="images/quality-lint/raw-logs.png" alt="raw-logs" style="width:200px;"/>
- If your add-on has some Java code, you need to have Java installed locally, so Java linter will work.
**Artifacts:**
- No additional artifacts, Failure details are available in the logs.
- No additional artifacts, failure details are available in the logs.
security-detect-secrets
Expand Down
Binary file removed images/quality-lint/error.png
Binary file not shown.
Binary file removed images/quality-lint/raw-logs.png
Binary file not shown.
Binary file removed images/quality-lint/summary.png
Binary file not shown.
Binary file removed images/quality-lint/summary2.png
Binary file not shown.

0 comments on commit f8c2a6c

Please sign in to comment.