Skip to content

Commit

Permalink
[ci] use yamllint, update pre-commit hooks (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Nov 29, 2024
1 parent 471660e commit 259dcc2
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/new-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ body:
label: Will this check introduce any additional configuration?
description: |
For example, the `too-many-files` checks introduced configuration option
`--max-allowed-files` to allow user control over how many files are allowed in a distribution.
`--max-allowed-files` to allow user control over how many files are allowed
in a distribution.
options:
- 'yes'
- 'no'
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@ jobs:
conda install \
--yes \
-c conda-forge \
pre-commit \
requests \
types-requests \
yamllint
pre-commit
make lint
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
- types-requests
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.7.2
rev: v0.8.0
hooks:
# Run the linter.
- id: ruff
Expand Down Expand Up @@ -52,3 +52,7 @@ repos:
- click>=8.0
- sphinx>=7.3
- sphinx-click>=6.0
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
22 changes: 22 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
extends: default

rules:
anchors:
forbid-undeclared-aliases: true
forbid-duplicated-anchors: true
forbid-unused-anchors: true
braces:
forbid: false
min-spaces-inside: 0
# allow 1 space for jinja templating in conda recipes
max-spaces-inside: 1
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
line-length:
max: 120
truthy:
allowed-values: ['false', 'true']
# having problematic value in keys is rare... and also
# GitHub Actions' choie of 'on:' triggers this check
# ref: https://github.com/adrienverge/yamllint/issues/430
check-keys: false
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ install:
.PHONY: lint
lint:
pre-commit run --all-files
yamllint \
--strict \
-d '{extends: default, rules: {braces: {max-spaces-inside: 1}, truthy: {check-keys: false}, line-length: {max: 120}}}' \
.

.PHONY: linux-wheel
linux-wheel:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[![PyPI Version](https://img.shields.io/pypi/v/pydistcheck.svg?logo=pypi&logoColor=white)](https://pypi.org/project/pydistcheck)
[![PyPI downloads](https://static.pepy.tech/badge/pydistcheck)](https://pypi.org/project/pydistcheck)
[![Documentation Status](https://readthedocs.org/projects/pydistcheck/badge/?version=latest)](https://pydistcheck.readthedocs.io/)
[![GitHub Actions](https://github.com/jameslamb/pydistcheck/workflows/unit-tests/badge.svg?branch=main)](https://github.com/jameslamb/pydistcheck/actions/workflows/unit-tests.yml)
[![GitHub Actions](https://github.com/jameslamb/pydistcheck/workflows/smoke-tests/badge.svg?branch=main)](https://github.com/jameslamb/pydistcheck/actions/workflows/smoke-tests.yml)
[![GitHub Actions](https://github.com/jameslamb/pydistcheck/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/jameslamb/pydistcheck/actions/workflows/unit-tests.yml)
[![GitHub Actions](https://github.com/jameslamb/pydistcheck/actions/workflows/smoke-tests.yml/badge.svg?branch=main)](https://github.com/jameslamb/pydistcheck/actions/workflows/smoke-tests.yml)

## What is `pydistcheck`?

Expand Down
2 changes: 1 addition & 1 deletion src/pydistcheck/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ def _import_zstandard() -> Any:
raise ModuleNotFoundError(err_msg) from err


__all__ = ["tomllib", "_import_zstandard"]
__all__ = ["_import_zstandard", "tomllib"]

0 comments on commit 259dcc2

Please sign in to comment.