From 5a0a366b29b237c3d895697cd6ae2de74be44c40 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Mon, 23 Oct 2023 13:44:19 +0530 Subject: [PATCH] ci: Added code linters --- .github/linters/.hadolint.yaml | 4 + .github/linters/.markdown-lint.yml | 33 ++++++++ .github/linters/sun_checks.xml | 118 +++++++++++++++++++++++++++++ .github/workflows/linter.yml | 26 +++++++ .idea/jsonSchemas.xml | 32 ++++++++ 5 files changed, 213 insertions(+) create mode 100644 .github/linters/.hadolint.yaml create mode 100644 .github/linters/.markdown-lint.yml create mode 100644 .github/linters/sun_checks.xml create mode 100644 .github/workflows/linter.yml diff --git a/.github/linters/.hadolint.yaml b/.github/linters/.hadolint.yaml new file mode 100644 index 000000000..575b3529d --- /dev/null +++ b/.github/linters/.hadolint.yaml @@ -0,0 +1,4 @@ +failure-threshold: warning +ignored: + - DL3000 + - DL3029 \ No newline at end of file diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 000000000..2967d8af3 --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,33 @@ +default: true +MD001: true # Header levels should only increment by one level at a time +MD003: + style: consistent # Header style +MD004: + style: consistent # Unordered list style +MD005: true # Inconsistent indentation for list items at the same level +MD022: true # Headers should be surrounded by blank lines +MD023: true # Headers must start at the beginning of the line +MD024: true # Multiple headers with the same content +MD026: + punctuation: ".,;:!" # Trailing punctuation in header +MD027: true # Multiple spaces after blockquote symbol +MD028: true # Blank line inside blockquote +MD029: true # Ordered list item prefix +MD036: + punctuation: ".,;:!?。,;:!?" # Emphasis used instead of a header +MD037: true # Spaces inside emphasis markers +MD038: true # Spaces inside code span elements +MD039: true # Spaces inside link text +MD040: true # Fenced code blocks should have a language specified +MD042: true # No empty links +MD044: true # Proper names should have the correct capitalization +MD045: true # Images should have an alternate text (alt text) +MD046: + style: fenced # Code block style +MD048: + style: backtick # Code block fence style +MD049: + style: consistent # Emphasis style should be consistent +MD050: + style: consistent # Strong style should be consistent +MD051: true # Link Fragments should be valid \ No newline at end of file diff --git a/.github/linters/sun_checks.xml b/.github/linters/sun_checks.xml new file mode 100644 index 000000000..b2ef7d345 --- /dev/null +++ b/.github/linters/sun_checks.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 000000000..e91dbad30 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,26 @@ +name: Lint Code Base + +on: + push: + pull_request: + +jobs: + build: + name: Lint Code Base + runs-on: ubuntu-latest + permissions: + contents: read + packages: read + statuses: write + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + # Full git history is needed to get a proper + # list of changed files within `super-linter` + fetch-depth: 0 + - name: Lint Code Base + uses: super-linter/super-linter@v5 + env: + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.idea/jsonSchemas.xml b/.idea/jsonSchemas.xml index dbb63a546..4c544fd85 100644 --- a/.idea/jsonSchemas.xml +++ b/.idea/jsonSchemas.xml @@ -19,6 +19,38 @@ + + + + + + + + + + + + + +