Skip to content

Commit

Permalink
👷 Add yamlfmt pre-commit hook (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange authored Feb 22, 2024
1 parent db9047c commit d15007b
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 23 deletions.
17 changes: 9 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
github-actions:
patterns:
- '*'
1 change: 1 addition & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CD

on:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CI
on:
pull_request:
Expand All @@ -9,9 +10,9 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: n1hility/cancel-previous-runs@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: n1hility/cancel-previous-runs@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

build:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -41,7 +42,8 @@ jobs:
with:
save-always: true
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ matrix.python-version }}-${{ hashFiles('**/requirements/ci.txt') }}-${{ hashFiles('.pre-commit-config.yaml') }}
key: ${{ runner.os }}-pre-commit-${{ matrix.python-version }}-${{ hashFiles('**/requirements/ci.txt') }}-${{ hashFiles('.pre-commit-config.yaml')
}}

- name: Install
run: |
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
Expand All @@ -9,16 +10,16 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: CodeQL

on:
push:
branches: [ "master" ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
branches: [master]
schedule:
- cron: '35 22 * * 1'
- cron: 35 22 * * 1

jobs:
analyze:
Expand All @@ -32,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
language: [python]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

Expand Down
17 changes: 12 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
Expand All @@ -17,16 +18,16 @@ repos:
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
args: [--baseline, .secrets.baseline]
exclude: .*/tests/.*
additional_dependencies: ['gibberish-detector']
additional_dependencies: [gibberish-detector]

# should be replaced in the future ref https://github.com/astral-sh/ruff/issues/3792
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: ['black==24.2.0']
additional_dependencies: [black==24.2.0]

- repo: local
hooks:
Expand All @@ -41,13 +42,19 @@ repos:
rev: v0.23.1
hooks:
- id: toml-sort-fix
args: ['--trailing-comma-inline-array']
args: [--trailing-comma-inline-array]

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt
args: [--mapping=2, --sequence=2, --offset=0]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: mixed-line-ending
args: ['--fix=lf']
args: [--fix=lf]
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: \.(svg)$
Expand Down
3 changes: 2 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
Expand All @@ -9,7 +10,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
python: '3.12'

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down

0 comments on commit d15007b

Please sign in to comment.