Skip to content

Commit b4776d9

Browse files
authored
Migrate away from Prettier (#257)
1 parent 671f151 commit b4776d9

16 files changed

+101
-126
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
---
12
# Used to test console encoding issues when running with pre-commit on Windows
23
# See: https://github.com/jsh9/pydoclint/issues/20
3-
44
repos:
55
- repo: local
66
hooks:
@@ -9,4 +9,4 @@ repos:
99
entry: pydoclint --config=pyproject.toml
1010
language: system
1111
types: [python]
12-
exclude: "^(setup\\.py$|tests?/)"
12+
exclude: ^(setup\.py$|tests?/)
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1+
---
12
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
23
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
44
name: Python package
5-
65
on:
76
push:
8-
branches: ["main"]
7+
branches: [main]
98
pull_request:
10-
branches: ["main"]
11-
9+
branches: [main]
1210
jobs:
1311
build:
1412
name: Test Python ${{ matrix.python-version }} (${{ matrix.os }})
@@ -17,8 +15,7 @@ jobs:
1715
fail-fast: false
1816
matrix:
1917
os: [ubuntu-latest, windows-latest, macOS-latest]
20-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
21-
18+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2219
steps:
2320
- uses: actions/checkout@v3
2421
- name: Set up Python ${{ matrix.python-version }}
@@ -31,22 +28,20 @@ jobs:
3128
python -m pip install tox tox-gh-actions
3229
- name: Test with tox
3330
run: tox
34-
3531
test-pre-commit-console-encoding:
3632
# Ref.: https://github.com/jsh9/pydoclint/issues/20
3733
name: Test pre-commit console encoding
3834
runs-on: windows-latest
39-
4035
steps:
4136
- uses: actions/checkout@v3
4237
- name: Set up Python 3.9
4338
uses: actions/setup-python@v3
4439
with:
4540
# This is just a sanity check, so we only run it on one Python version
4641
# in order to save some time
47-
python-version: "3.9"
42+
python-version: '3.9'
4843
- name: Run check-self with pre-commit
49-
run: |
44+
run: |-
5045
python -m pip install --upgrade pip
5146
python -m pip install pre-commit -e .
5247
python -m pre_commit run -c .github/.pre-commit-config-self-check.yaml check-self --all

.github/workflows/python-publish.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
1+
---
12
# This workflow will upload a Python Package using Twine when a release is created
23
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
34

45
# This workflow uses actions that are not certified by GitHub.
56
# They are provided by a third-party and are governed by
67
# separate terms of service, privacy policy, and support
78
# documentation.
8-
99
name: Upload Python Package
10-
1110
on:
1211
release:
1312
types: [published]
14-
workflow_dispatch:
15-
13+
workflow_dispatch: null
1614
permissions:
1715
contents: read
18-
1916
jobs:
2017
deploy:
2118
runs-on: ubuntu-latest
22-
2319
steps:
2420
- uses: actions/checkout@v3
2521
- name: Set up Python
2622
uses: actions/setup-python@v3
2723
with:
28-
python-version: "3.x"
24+
python-version: 3.x
2925
- name: Install dependencies
3026
run: |
3127
python -m pip install --upgrade pip

.pre-commit-config.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,50 @@
1+
---
12
repos:
23
- repo: https://github.com/pycqa/isort
34
rev: 6.0.1
45
hooks:
56
- id: isort
6-
77
- repo: https://github.com/jsh9/muff-pre-commit
88
rev: 0.12.11.1
99
hooks:
1010
- id: muff-format
1111
args: [--config, muff.toml]
12-
13-
- repo: https://github.com/pre-commit/mirrors-prettier
14-
rev: v4.0.0-alpha.8
12+
- repo: https://github.com/lyz-code/yamlfix
13+
rev: 1.17.0
1514
hooks:
16-
- id: prettier
17-
15+
- id: yamlfix
16+
- repo: https://github.com/hukkin/mdformat
17+
rev: 0.7.22 # Use the ref you want to point at
18+
hooks:
19+
- id: mdformat
20+
args: [--wrap, '79']
21+
additional_dependencies: [mdformat-tables]
1822
- repo: https://github.com/pre-commit/pre-commit-hooks
1923
rev: v6.0.0
2024
hooks:
2125
- id: end-of-file-fixer
2226
- id: trailing-whitespace
23-
27+
- id: pretty-format-json
28+
args: [--no-ensure-ascii, --indent=4, --no-sort-keys]
2429
- repo: https://github.com/pre-commit/pre-commit
2530
rev: v4.3.0
2631
hooks:
2732
- id: validate_manifest
28-
2933
- repo: https://github.com/jsh9/markdown-toc-creator
3034
rev: 0.0.10
3135
hooks:
3236
- id: markdown-toc-creator
33-
3437
- repo: local
3538
hooks:
3639
- id: copy_readme
3740
name: copy_readme
3841
entry: python .pre_commit_helper_scripts/copy_readme.py
3942
language: system
4043
types: [python]
41-
4244
- repo: local
4345
hooks:
4446
- id: check_full_diff_in_changelog
4547
name: Check "full diff" exists in CHANGELOG.md
4648
entry: python .pre_commit_helper_scripts/check_full_diff_in_changelog.py
4749
language: python
48-
additional_dependencies: ["markdown-it-py"]
50+
additional_dependencies: [markdown-it-py]

.pre-commit-hooks.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
---
12
- id: pydoclint
23
name: pydoclint
3-
description: "A Python docstring linter that checks arguments, returns, yields, and raises sections"
4+
description: A Python docstring linter that checks arguments, returns, yields,
5+
and raises sections
46
entry: pydoclint
57
language: python
68
types: [python]
79
require_serial: true
810
- id: pydoclint-flake8
911
name: pydoclint-flake8
10-
description: "Run `pydoclint` as a `flake8` plugin"
12+
description: Run `pydoclint` as a `flake8` plugin
1113
entry: flake8
1214
args: [--select=DOC]
1315
language: python

.prettierrc.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
---
12
printWidth: 79
23
endOfLine: auto
34
overrides:
4-
- files: "*.md"
5+
- files: '*.md'
56
options:
67
proseWrap: always

0 commit comments

Comments
 (0)