Skip to content

Commit

Permalink
gh-170: add yamllint and run over the repo (#230)
Browse files Browse the repository at this point in the history
Add `yamllint` as a pre-commit hook and format all
the YAML files in the repository.

Refs: #170
Co-authored-by: Saransh Chopra <[email protected]>
  • Loading branch information
paddyroddy and Saransh-cpp authored Sep 23, 2024
1 parent 0293646 commit 46bbd92
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 12 deletions.
9 changes: 5 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: github-actions
directory: /
schedule:
interval: "weekly"
interval: weekly
commit-message:
prefix: "DEV"
prefix: DEV
7 changes: 4 additions & 3 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
name: Test examples

on:
push:
paths:
- "glass/**"
- glass/**
branches:
- main
pull_request:
paths:
- "glass/**"
- glass/**

concurrency:
# Skip intermediate builds: always.
Expand All @@ -27,6 +28,6 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version: 3.x
cache: pip
- run: pipx run --spec '.[examples]' jupyter execute examples/**/*.ipynb
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: PR Title Checker
on:
pull_request_target:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
name: Release

on:
workflow_dispatch:
inputs:
target:
description: 'Deployment target. Can be "pypi" or "testpypi"'
default: "testpypi"
description: Deployment target. Can be pypi or testpypi.
default: testpypi
release:
types:
- published
Expand All @@ -30,7 +31,8 @@ jobs:
path: dist/*

publish:
needs: [dist]
needs:
- dist
runs-on: ubuntu-latest
environment:
name: publish
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Test

on:
Expand All @@ -19,7 +20,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
with:
Expand Down
51 changes: 50 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
ci:
autoupdate_commit_msg: "MNT: update pre-commit hooks"
autofix_commit_msg: "STY: pre-commit fixes"
Expand All @@ -24,11 +25,59 @@ repos:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args:
- >-
--config-data={
extends: default,
rules: {
anchors: enable,
braces: {
forbid: non-empty
},
brackets: {
forbid: non-empty
},
colons: enable,
commas: enable,
comments: {
min-spaces-from-content: 1
},
comments-indentation: enable,
document-end: disable,
document-start: enable,
empty-lines: enable,
empty-values: disable,
float-values: enable,
hyphens: enable,
indentation: enable,
key-duplicates: enable,
key-ordering: disable,
line-length: enable,
new-line-at-end-of-file: enable,
new-lines: enable,
octal-values: enable,
quoted-strings: {
quote-type: double,
required: only-when-needed
},
trailing-spaces: enable,
truthy: {
check-keys: false
}
}
}
- --strict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.3
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
args:
- --fix
- --show-fixes
- id: ruff-format
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2

build:
Expand Down

0 comments on commit 46bbd92

Please sign in to comment.