feat(CI): add the GitHub Super Linter

The GitHub Super Linter is a more robust and better supported
tool than the current GitHub Actions we are using.

Running these checks:

ERROR_ON_MISSING_EXEC_BIT: true
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_EDITORCONFIG: true
VALIDATE_MARKDOWN: true
VALIDATE_SHELL_SHFMT: true
VALIDATE_YAML: true

https://github.com/marketplace/actions/super-linter
https://github.com/github/super-linter

Added the GitHub Super Linter badge to the README.

Also updated the pre-commit framework and added
more documentation on pre-commit.

Added one more pre-commit check: check-executables-have-shebangs

Added one extra check for merge conflicts to our
GitHub Actions.

EditorConfig and Markdown linting.

Minor grammar and spelling fixes.

Update linter.yml
This commit is contained in:
John Bampton
2021-04-11 12:51:28 +10:00
committed by Yukihiro "Matz" Matsumoto
parent ac9038121b
commit 9d32d440eb
49 changed files with 300 additions and 260 deletions
+12
View File
@@ -0,0 +1,12 @@
{
"verbose": false,
"ignore_defaults": false,
"exclude": ["oss-fuzz/", "src/"],
"disable": {
"end_of_line": false,
"trim_trailing_whitespace": false,
"insert_final_newline": false,
"indent_size": true,
"indent_style": true
}
}
+12
View File
@@ -0,0 +1,12 @@
MD001: false
MD003: false
MD005: false
MD007: false
MD010: false
MD013: false
MD014: false
MD024: false
MD025: false
MD026: false
MD040: false
MD046: false
+8
View File
@@ -0,0 +1,8 @@
---
extends: default
rules:
document-start: disable
line-length: disable
truthy: false
+15 -35
View File
@@ -1,52 +1,32 @@
name: ❄️ Lint
name: Lint
on: [pull_request]
jobs:
markdownlint:
name: 🍸 Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🚀 Use Node.js
uses: actions/setup-node@v2.1.5
with:
node-version: '14'
- run: npm install -g markdownlint-cli@0.27.1
- run: markdownlint '**/*.md'
misspell:
name: 🥛 Check Spelling
name: Check Spelling
runs-on: ubuntu-latest
steps:
- name: 🍒 Check Out
- name: Check Out
uses: actions/checkout@v2
- name: 🍅 Install
- name: Install
run: |
wget -O - -q https://git.io/misspell | sh -s -- -b .
- name: 🌶️ Misspell
- name: Misspell
run: |
git ls-files --empty-directory | xargs ./misspell -error
merge-conflict:
name: Merge Conflict
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check merge conflict
run: |
grep "^<<<<<<< HEAD" $(git ls-files | xargs) && exit 1 || true
trailing-whitespace:
name: 🧋 Trailing whitespace
name: Trailing whitespace
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🧹 Check for trailing whitespace
- name: Check for trailing whitespace
run: "! git grep -EIn $'[ \t]+$'"
yamllint:
name: 🍶 YAML
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install yamllint
- name: 🧹 YAML Lint
run: |
# return non-zero exit code on warnings
yamllint --strict .
+25
View File
@@ -0,0 +1,25 @@
name: Lint Code Base
on:
push:
branches-ignore: [master]
# Remove the line above to run when pushing to master
pull_request:
branches: [master]
jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: github/super-linter@v3
env:
ERROR_ON_MISSING_EXEC_BIT: true
VALIDATE_BASH: true
# VALIDATE_BASH_EXEC: true
# VALIDATE_EDITORCONFIG: true
VALIDATE_MARKDOWN: true
# VALIDATE_SHELL_SHFMT: true
VALIDATE_YAML: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}