Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generic linters and checks #11

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# EditorConfig is awesome: https://EditorConfig.org

[*]
# Ensure consistent file encoding in UNIX style
charset = utf-8
end_of_line = lf
40 changes: 40 additions & 0 deletions .github/workflows/check-generic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Generic checks to ease collaboration:
# - consistent file encoding in UNIX style
# - whitespaces in all purposes files like markdown, yaml, etc
name: Check Generic

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
editorconfig-checker:
name: Run editorconfig-checker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run editorconfig-checker
run: docker run --rm --volume=$PWD:/check mstruebing/editorconfig-checker

markdownlint:
name: Run markdownlint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run markdownlint-cli2
uses: DavidAnson/markdownlint-cli2-action@v16

yamllint:
name: Run yamllint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run yamllint
run: yamllint .
67 changes: 67 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Check Code Quality and Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint-eslint:
name: Lint ESLint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ">=18.x"

- name: Install dependencies
run: npm install

- name: Run ESLint
run: npm run lint

lint-prettier:
name: Lint Prettier
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ">=18.x"

- name: Install dependencies
run: npm install

- name: Run Prettier
run: npm run prettier

test:
name: Run Tests
runs-on: ubuntu-latest
needs:
- lint-eslint
- lint-prettier

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ">=18.x"

- name: Install dependencies
run: npm install

- name: Run Tests
run: npm run test
35 changes: 0 additions & 35 deletions .github/workflows/ci.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Disable some built-in rules
config:
line-length: false
no-inline-html: false
first-line-h1: false
code-block-style: false # conflicts with MkDocs Admontions: https://squidfunk.github.io/mkdocs-material/reference/admonitions/
code-fence-style:
style: backtick

# Define glob expressions to use (only valid at root)
globs:
- "**/*.md"

# Ignore files that are not part of version control
gitignore: true
16 changes: 16 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extends: default

ignore-from-file: .gitignore

rules:
document-start: disable
indentation:
spaces: 2
line-length: disable
quoted-strings:
quote-type: double
required: only-when-needed
allow-quoted-quotes: true
check-keys: true
truthy:
check-keys: false
Loading