From f5ba6f9659f9ba6f16343710183f58427d6c4456 Mon Sep 17 00:00:00 2001 From: Milson Munakami Date: Thu, 1 Aug 2024 14:32:38 -0400 Subject: [PATCH] updated CI CD yaml files with new versions --- .github/workflows/ci.yml | 33 ++++++++++---------- .github/workflows/precommit.yaml | 2 +- .markdownlint.json | 2 +- .markdownlint.yaml | 6 ++++ .pre-commit-config.yaml | 53 +++++++++++++++++++------------- .yamllint.yaml | 23 +++++++++++--- 6 files changed, 75 insertions(+), 44 deletions(-) create mode 100644 .markdownlint.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f55982d..c4179563 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,10 +4,9 @@ name: Build and Deploy Documentation using MkDocs # but pull request events on any branch but deployement happens only for the main branch on: push: - branches: - - main + branches: [main] pull_request: - # branches: [main] + # branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -24,21 +23,21 @@ jobs: python-version: [3.10.12] steps: - - name: Checkout Main - uses: actions/checkout@v4 + - name: Checkout Main + uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies and setup git config - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - git config user.name 'github-actions[bot]' && git config user.email 'help@nerc.mghpcc.org' - - name: Clean Build - run: | - mkdocs build --clean + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies and setup git config + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + git config user.name 'github-actions[bot]' && git config user.email 'help@nerc.mghpcc.org' + - name: Clean Build + run: | + mkdocs build --clean deploy: name: Deploy Documentation needs: build diff --git a/.github/workflows/precommit.yaml b/.github/workflows/precommit.yaml index d360ddef..d84e1e2f 100644 --- a/.github/workflows/precommit.yaml +++ b/.github/workflows/precommit.yaml @@ -14,7 +14,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '^3.10' + python-version: ^3.10 - name: Configure caching uses: actions/cache@v4 diff --git a/.markdownlint.json b/.markdownlint.json index c7546cdd..59d4b1d9 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,4 +1,4 @@ { "default": true, - "MD013": {"code_blocks": false, "tables": false, "headings": false} + "MD013": { "code_blocks": false, "tables": false, "headings": false } } diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 00000000..cb773b1f --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,6 @@ +# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for all rules. +default: true +MD013: + code_blocks: false + tables: false + headings: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 99876456..58fcf0f6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,52 +1,63 @@ ---- +ci: + autofix_commit_msg: "style(pre-commit): autofix" + autoupdate_commit_msg: "ci(pre-commit): autoupdate" + repos: - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.1.10 + rev: v1.5.5 hooks: + - id: forbid-crlf + - id: remove-crlf + - id: forbid-tabs - id: remove-tabs - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.6.0 hooks: - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] - id: check-merge-conflict - id: end-of-file-fixer + - id: mixed-line-ending - id: check-added-large-files - id: check-case-conflict - id: check-json - id: check-yaml - args: - - '--allow-multiple-documents' + args: [--unsafe, --allow-multiple-documents] - id: check-symlinks - id: detect-private-key - - repo: https://github.com/adrienverge/yamllint.git - rev: v1.26.3 + - repo: https://github.com/adrienverge/yamllint + rev: v1.35.1 hooks: - id: yamllint files: \.(yaml|yml)$ types: [file, yaml] entry: yamllint --strict + exclude: .*.param.yaml - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.29.0 + rev: v0.40.0 hooks: - - id: markdownlint + - id: markdownlint + args: [-c, .markdownlint.yaml, --fix] - repo: https://github.com/Yelp/detect-secrets - rev: v1.1.0 + rev: v1.5.0 hooks: - - id: detect-secrets - args: ['--baseline', '.secrets.baseline'] - exclude: .*/tests/.* + - id: detect-secrets + args: [--baseline, .secrets.baseline] + exclude: .*/tests/.* - repo: https://github.com/pycqa/flake8 - rev: '4.0.1' + rev: 7.0.0 hooks: - - id: flake8 - args: - # these are errors that will be ignored by flake8 - # check out their meaning here - # https://flake8.pycqa.org/en/latest/user/error-codes.html - - '--ignore=E501,F401' - exclude: ^testing/(data|examples)/ + - id: flake8 + args: + # these are errors that will be ignored by flake8 + # check out their meaning here + # https://flake8.pycqa.org/en/latest/user/error-codes.html + - --ignore=E501,F401 + exclude: ^testing/(data|examples)/ + +exclude: .svg diff --git a/.yamllint.yaml b/.yamllint.yaml index 8bb476b0..21ad6066 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -1,11 +1,26 @@ ---- extends: default + +ignore: | + *.param.yaml + rules: - line-length: disable - document-start: disable + braces: + level: error + max-spaces-inside: 1 # To format with Prettier + comments: + level: error + min-spaces-from-content: 1 # To be compatible with C++ and Python + document-start: + level: error + present: false # Don't need document start markers + line-length: disable # Delegate to Prettier indentation: indent-sequences: whatever hyphens: max-spaces-after: 4 truthy: - check-keys: false + level: error + check-keys: false # To allow 'on' of GitHub Actions + quoted-strings: + level: error + required: only-when-needed # To keep consistent style