Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
Run:
name: "Flake8"
permissions:
contents: read
runs-on: "ubuntu-22.04"

steps:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ on:
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
Run:
permissions:
contents: read
name: "mypy / ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/octocheese.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ on:
schedule:
- cron: 0 12 * * *

permissions:
contents: write

jobs:
Run:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: domdfcoding/octocheese@master
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ on:

pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
tests:
permissions:
actions: write
contents: read
name: "windows-2022 / Python ${{ matrix.config.python-version }}"
runs-on: "windows-2022"
continue-on-error: ${{ matrix.config.experimental }}
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ on:
- '*'
pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
tests:
permissions:
actions: write
contents: read
name: "ubuntu-22.04 / Python ${{ matrix.config.python-version }}"
runs-on: "ubuntu-22.04"
continue-on-error: ${{ matrix.config.experimental }}
Expand Down Expand Up @@ -82,6 +80,9 @@ jobs:

Coverage:
needs: tests
permissions:
actions: write
contents: read
runs-on: "ubuntu-22.04"
steps:
- name: Checkout 🛎️
Expand Down Expand Up @@ -131,7 +132,10 @@ jobs:

Deploy:
needs: tests

permissions:
actions: write
issues: write
contents: read
runs-on: "ubuntu-22.04"
steps:
- name: Checkout 🛎️
Expand Down Expand Up @@ -162,7 +166,7 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true
skip-existing: true

- name: Close milestone 🚪
if: startsWith(github.ref, 'refs/tags/')
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/python_ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ on:

pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
tests:
permissions:
actions: write
contents: read
name: "macos-${{ matrix.config.os-ver }} / Python ${{ matrix.config.python-version }}"
runs-on: "macos-${{ matrix.config.os-ver }}"
continue-on-error: ${{ matrix.config.experimental }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ docs/_build/
doc/build
target/
.ipynb_checkpoints
.python-version
celerybeat-schedule
celerybeat.pid
*.sage.py
Expand Down
11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ci:

repos:
- repo: https://github.com/repo-helper/pyproject-parser
rev: v0.13.0
rev: v0.14.0
hooks:
- id: reformat-pyproject

Expand All @@ -18,7 +18,6 @@ repos:
- id: check-added-large-files
- id: check-ast
- id: fix-byte-order-marker
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
Expand All @@ -33,7 +32,7 @@ repos:
- id: end-of-file-fixer

- repo: https://github.com/domdfcoding/pre-commit-hooks
rev: v0.4.0
rev: v0.5.0
hooks:
- id: requirements-txt-sorter
args:
Expand Down Expand Up @@ -81,13 +80,15 @@ repos:
- id: snippet-fmt

- repo: https://github.com/python-formate/formate
rev: v0.8.0
rev: v1.1.2
hooks:
- id: formate
exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$
additional_dependencies:
- formate-trailing-commas>=0.1.1

- repo: https://github.com/python-coincidence/dep_checker
rev: v0.8.0
rev: v0.9.0
hooks:
- id: dep_checker
args:
Expand Down
2 changes: 1 addition & 1 deletion .style.yapf
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ split_before_dict_set_generator=True
#
# foo = ('This is a really long string: {}, {}, {}, {}'
# .format(a, b, c, d))
split_before_dot=False
split_before_dot=True

# Split after the opening paren which surrounds an expression if it doesn't
# fit on a single line.
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ formate-black
:target: https://github.com/python-formate/formate-black/commit/master
:alt: GitHub last commit

.. |maintained| image:: https://img.shields.io/maintenance/yes/2025
.. |maintained| image:: https://img.shields.io/maintenance/yes/2026
:alt: Maintenance

.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/formate-black
:target: https://pypi.org/project/formate-black/
:target: https://pypistats.org/packages/formate-black
:alt: PyPI - Downloads

.. end shields
Expand Down
21 changes: 7 additions & 14 deletions formate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ reformat-generics = 40
noqa-reformat = 60
ellipsis-reformat = 70
squish_stubs = 80
newline_after_equals = 90

[hooks.yapf]
priority = 30

[hooks.yapf.kwargs]
yapf_style = ".style.yapf"

[hooks.trailing_commas]
priority = 21

[hooks.trailing_commas.kwargs]
format_ImportFrom = false

[hooks.isort]
priority = 50

Expand All @@ -27,20 +34,6 @@ lines_between_types = 0
use_parentheses = true
remove_redundant_aliases = true
default_section = "THIRDPARTY"
known_third_party = [
"black",
"coincidence",
"coverage",
"coverage_pyver_pragma",
"domdf_python_tools",
"formate",
"importlib_metadata",
"parameterized",
"pytest",
"pytest_cov",
"pytest_randomly",
"pytest_timeout",
]
known_first_party = [ "formate_black",]

[config]
Expand Down
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ unused-imports:
incomplete-defs:
tox -e lint -- --select MAN

commas:
tox -e lint -- --select C810,C812,C813,C814,C815,C816

vdiff:
git diff $(repo-helper show version -q)..HEAD

Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,24 @@ deps =
flake8-dunder-all>=0.1.1
flake8-encodings>=0.1.0
flake8-github-actions>=0.1.0
flake8-noqa>=1.1.0,<=1.2.2
git+https://github.com/python-formate/flake8-noqa.git@v1.2.2-python-formate.0
flake8-pyi>=20.10.0,<=22.8.0
flake8-pytest-style>=1.3.0,<2
flake8-quotes>=3.3.0
flake8-slots>=0.1.0
flake8-sphinx-links>=0.0.4
flake8-strftime>=0.1.1
flake8-typing-imports>=1.10.0
flake8-params>=0.1.0
flake8-unused-fstrings>=2.0.0
git+https://github.com/python-formate/flake8-commas.git@4.0.0-python-formate.0
git+https://github.com/domdfcoding/restructuredtext-lint.git@fix-deprecations
git+https://github.com/domdfcoding/flake8-rst-docstrings-sphinx.git
git+https://github.com/domdfcoding/flake8-rst-docstrings.git
git+https://github.com/python-formate/flake8-unused-arguments.git@magic-methods
git+https://github.com/python-formate/flake8-missing-annotations.git
git+https://github.com/domdfcoding/pydocstyle.git@stub-functions
pygments>=2.7.1
importlib_metadata<4.5.0; python_version<'3.8'
commands = python3 -m flake8_rst_docstrings_sphinx formate_black tests --allow-toolbox {posargs}

[testenv:perflint]
Expand Down
Loading