Skip to content

Commit 0918abe

Browse files
authored
Integrate with yaml sort. (#21)
1 parent 793ff23 commit 0918abe

File tree

11 files changed

+155
-137
lines changed

11 files changed

+155
-137
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
github: [huxuan]
1+
github:
2+
- huxuan

.github/FUNDING.yml.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
github: [{{ repo_namespace }}]
1+
github:
2+
- {{ repo_namespace }}

.github/workflows/ci.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,50 @@
1-
name: CI
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
types: [opened, synchronize]
9-
101
jobs:
112
lint:
123
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
python-version: ["3.8", "3.9", "3.10", "3.11"]
164
steps:
175
- uses: actions/checkout@v3
186
- name: Set up Python ${{ matrix.python-version }}
197
uses: actions/setup-python@v4
208
with:
9+
cache: pip
2110
python-version: ${{ matrix.python-version }}
22-
cache: "pip"
2311
- run: make dev-lint
2412
- run: make lint
25-
tests:
26-
runs-on: ubuntu-latest
2713
strategy:
2814
matrix:
29-
python-version: ["3.8", "3.9", "3.10", "3.11"]
15+
python-version:
16+
- '3.8'
17+
- '3.9'
18+
- '3.10'
19+
- '3.11'
20+
tests:
21+
runs-on: ubuntu-latest
3022
steps:
3123
- uses: actions/checkout@v3
3224
- name: Set up Python ${{ matrix.python-version }}
3325
uses: actions/setup-python@v4
3426
with:
27+
cache: pip
3528
python-version: ${{ matrix.python-version }}
36-
cache: "pip"
3729
- run: make dev-tests
3830
- run: make tests
3931
- name: Upload coverage to Codecov
4032
uses: codecov/codecov-action@v3
4133
with:
4234
flags: ${{ matrix.python-version }}
35+
strategy:
36+
matrix:
37+
python-version:
38+
- '3.8'
39+
- '3.9'
40+
- '3.10'
41+
- '3.11'
42+
name: CI
43+
on:
44+
pull_request:
45+
types:
46+
- opened
47+
- synchronize
48+
push:
49+
branches:
50+
- main

.github/workflows/package.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
name: Upload Python Package
2-
3-
on:
4-
release:
5-
types: [published]
6-
7-
permissions:
8-
contents: read
9-
101
jobs:
112
deploy:
123
runs-on: ubuntu-latest
@@ -15,11 +6,18 @@ jobs:
156
- name: Set up Python
167
uses: actions/setup-python@v4
178
with:
18-
python-version: "3.x"
19-
cache: "pip"
9+
cache: pip
10+
python-version: 3.x
2011
- run: make dev-package
2112
- run: make build
2213
- name: Publish a Python distribution to PyPI
2314
uses: pypa/gh-action-pypi-publish@release/v1
2415
with:
2516
password: ${{ secrets.PYPI_API_TOKEN }}
17+
name: Upload Python Package
18+
on:
19+
release:
20+
types:
21+
- published
22+
permissions:
23+
contents: read
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1+
jobs:
2+
documentation-links:
3+
runs-on: ubuntu-latest
4+
steps:
5+
- uses: readthedocs/actions/preview@v1
6+
with:
7+
project-slug: serious-scaffold-python
18
name: Read the Docs Pull Request Preview
2-
39
on:
410
pull_request_target:
511
types:
612
- opened
7-
813
permissions:
914
pull-requests: write
10-
11-
jobs:
12-
documentation-links:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: readthedocs/actions/preview@v1
16-
with:
17-
project-slug: "serious-scaffold-python"
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1+
jobs:
2+
documentation-links:
3+
runs-on: ubuntu-latest
4+
steps:
5+
- uses: readthedocs/actions/preview@v1
6+
with:
7+
project-slug: {{ repo_name }}
18
name: Read the Docs Pull Request Preview
2-
39
on:
410
pull_request_target:
511
types:
612
- opened
7-
813
permissions:
914
pull-requests: write
10-
11-
jobs:
12-
documentation-links:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: readthedocs/actions/preview@v1
16-
with:
17-
project-slug: "{{ repo_name }}"

.pre-commit-config.yaml

Lines changed: 52 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
4-
hooks:
2+
- hooks:
53
- id: check-added-large-files
64
- id: check-docstring-first
75
- id: check-json
@@ -14,55 +12,65 @@ repos:
1412
- id: mixed-line-ending
1513
- id: name-tests-test
1614
- id: no-commit-to-branch
17-
stages: [push]
18-
- id: pretty-format-json
19-
args: [--autofix]
20-
- id: requirements-txt-fixer
21-
args:
22-
[
23-
constraints/default.txt,
24-
requirements.txt,
25-
requirements/docs.txt,
26-
requirements/lint.txt,
27-
requirements/package.txt,
28-
requirements/tests.txt,
29-
]
30-
- id: sort-simple-yaml
31-
files: .pre-commit-config.yaml
15+
stages:
16+
- push
17+
- args:
18+
- '--autofix'
19+
id: pretty-format-json
20+
- args:
21+
- constraints/default.txt
22+
- requirements.txt
23+
- requirements/docs.txt
24+
- requirements/lint.txt
25+
- requirements/package.txt
26+
- requirements/tests.txt
27+
id: requirements-txt-fixer
28+
- files: .pre-commit-config.yaml
29+
id: sort-simple-yaml
3230
- id: trailing-whitespace
33-
- repo: local
34-
hooks:
35-
- id: black
31+
repo: https://github.com/pre-commit/pre-commit-hooks
32+
rev: v4.4.0
33+
- hooks:
34+
- entry: pipenv run python -m black
35+
id: black
36+
language: system
3637
name: black
38+
types:
39+
- python
40+
- args:
41+
- '--filter-files'
42+
entry: pipenv run python -m isort
43+
id: isort
3744
language: system
38-
entry: pipenv run python -m black
39-
types: [python]
40-
- id: isort
4145
name: isort
42-
language: system
43-
entry: pipenv run python -m isort
4446
require_serial: true
45-
types_or: [cython, pyi, python]
46-
args: ["--filter-files"]
47-
- id: mypy
48-
name: mypy
47+
types_or:
48+
- cython
49+
- pyi
50+
- python
51+
- entry: make mypy
52+
id: mypy
4953
language: system
50-
entry: make mypy
51-
types: [python]
52-
require_serial: true
54+
name: mypy
5355
pass_filenames: false
54-
- id: ruff
56+
require_serial: true
57+
types:
58+
- python
59+
- entry: pipenv run python -m ruff
60+
id: ruff
61+
language: system
5562
name: ruff
63+
types:
64+
- python
65+
- entry: pipenv run toml-sort -a -i
66+
id: toml-sort
5667
language: system
57-
entry: pipenv run python -m ruff
58-
types: [python]
59-
- id: toml-sort
6068
name: toml-sort
61-
language: system
62-
entry: pipenv run toml-sort -a -i
63-
types: [toml]
64-
- id: forbidden-files
65-
name: forbidden files
66-
entry: found Copier update rejection files; review them and remove them
69+
types:
70+
- toml
71+
- entry: found Copier update rejection files; review them and remove them
72+
files: \.rej$
73+
id: forbidden-files
6774
language: fail
68-
files: "\\.rej$"
75+
name: forbidden files
76+
repo: local

.readthedocs.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
version: 2
2-
31
build:
42
os: ubuntu-22.04
53
tools:
6-
python: "3"
7-
4+
python: '3'
85
python:
96
install:
10-
- method: pip
11-
path: .
12-
extra_requirements:
7+
- extra_requirements:
138
- docs
9+
method: pip
10+
path: .
11+
version: 2

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"recommendations": [
3+
"PascalReitermann93.vscode-yaml-sort",
34
"charliermarsh.ruff",
45
"esbenp.prettier-vscode",
56
"ms-python.black-formatter",
67
"ms-python.python",
78
"richie5um2.vscode-sort-json",
8-
"shuworks.vscode-table-formatter",
99
"streetsidesoftware.code-spell-checker",
1010
"trond-snekvik.simple-rst"
1111
]

.vscode/settings.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
},
1212
"editor.defaultFormatter": "ms-python.black-formatter"
1313
},
14+
"[yaml]": {
15+
"editor.defaultFormatter": "PascalReitermann93.vscode-yaml-sort"
16+
},
1417
"cSpell.words": [
1518
"autofix",
1619
"automodule",
@@ -58,5 +61,20 @@
5861
"sortJSONTypeReverse": false,
5962
"sortJSONValues": false,
6063
"sortJSONValuesReverse": false
61-
}
64+
},
65+
"vscode-yaml-sort.customSortKeywords_2": [
66+
"_exclude",
67+
"project_name",
68+
"project_description",
69+
"repo_namespace",
70+
"author_name",
71+
"author_email",
72+
"repo_name",
73+
"package_name",
74+
"module_name"
75+
],
76+
"vscode-yaml-sort.noCompatMode": true,
77+
"vscode-yaml-sort.sortOnSave": 2,
78+
"vscode-yaml-sort.useAsFormatter": true,
79+
"vscode-yaml-sort.useLeadingDashes": false
6280
}

0 commit comments

Comments
 (0)