-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: adds pre-commit checks and formats markdown files (#14)
- Loading branch information
1 parent
2a30071
commit 9d77238
Showing
35 changed files
with
175 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Code Style | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
code-style-checks: | ||
name: Code Style Checks | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Get exact Python version | ||
run: echo "python_version=$(python --version)" >> $GITHUB_ENV | ||
|
||
- name: Cache Virtual Environment and pre-commit cache | ||
uses: actions/cache@v4 | ||
id: cache-pre-commit | ||
with: | ||
path: | | ||
venv | ||
pre-commit-cache | ||
key: v1-venv-pre-commit-${{ runner.os }}-${{ env.python_version }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
- name: Install pre-commit | ||
if: steps.cache-pre-commit.outputs.cache-hit != 'true' | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
pip install pre-commit | ||
- name: Run Style Check | ||
run: | | ||
source venv/bin/activate | ||
PRE_COMMIT_HOME="$PWD/pre-commit-cache" pre-commit run --all-files --color always --verbose --hook-stage manual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# documentation: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md | ||
|
||
# unordered list style | ||
MD004: | ||
style: dash | ||
|
||
# maximum line length | ||
# disable it | ||
MD013: false | ||
|
||
# multiple headings with the same context | ||
MD024: | ||
# duplication is allowed for headings with different parents | ||
siblings_only: true | ||
|
||
# code block style | ||
MD046: | ||
style: fenced | ||
|
||
# code fence style | ||
MD048: | ||
style: backtick | ||
|
||
# emphasis style | ||
MD049: | ||
style: asterisk | ||
|
||
# strong style | ||
MD050: | ||
style: asterisk | ||
|
||
# table pipe style | ||
MD055: | ||
style: leading_and_trailing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: [--fix=lf] | ||
- id: trailing-whitespace | ||
- id: check-shebang-scripts-are-executable | ||
|
||
- repo: https://github.com/DavidAnson/markdownlint-cli2 | ||
rev: v0.13.0 | ||
hooks: | ||
# manual stage for running in the ci so that it will print out the errors | ||
- id: markdownlint-cli2 | ||
name: Run markdownlint and log errors | ||
stages: [manual] | ||
|
||
- id: markdownlint-cli2 | ||
name: Run markdownlint and fix errors | ||
args: [--fix] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ custom | |
``` | ||
|
||
And in this case, only these items would be installed: | ||
|
||
```txt | ||
name | ||
item1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.