Merge pull request #381 from hynek/pre-commit_ci

Bootstrap pre-commit.ci
pull/382/head
Adi Roiban 6 months ago committed by GitHub
commit 3b52db76c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/workflows/ci.yml
  2. 2
      .gitignore
  3. 18
      .pre-commit-config.yaml
  4. 2
      admin/check_tag_version_match.py
  5. 1
      bin/towncrier
  6. 2
      docs/Makefile
  7. 3
      docs/conf.py
  8. 2
      docs/configuration.rst
  9. 2
      setup.py
  10. 1
      src/towncrier/newsfragments/330.misc
  11. 2
      src/towncrier/newsfragments/367.doc.rst
  12. 2
      src/towncrier/newsfragments/369.feature.rst
  13. 0
      src/towncrier/newsfragments/381.misc.rst
  14. 2
      src/towncrier/test/test_build.py
  15. 9
      tox.ini

@ -130,12 +130,8 @@ jobs:
tox: py39
action: 3.9
task:
- name: Flake8
tox: flake8
- name: Check Newsfragment
tox: check-newsfragment
- name: Run pre-commit hooks
tox: pre-commit
steps:
- uses: actions/checkout@v2

2
.gitignore vendored

@ -22,4 +22,4 @@ apidocs/
.coverage.*
.vscode
.idea
.python-version
.python-version

@ -1,7 +1,25 @@
---
ci:
autoupdate_schedule: monthly
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
language_version: python3.10
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: check-toml
- id: check-yaml

@ -24,7 +24,7 @@ if not run_version.startswith(TAG_PREFIX):
print(f"Not a twisted release tag name '{run_version}.")
sys.exit(1)
run_version = run_version[len(TAG_PREFIX) :]
run_version = run_version[len(TAG_PREFIX) :] # noqa: E203
if run_version != branch_version:
print(f"Branch is at '{branch_version}' while tag is '{run_version}'")

@ -1,4 +1,5 @@
#! /usr/bin/env python3
# flake8: noqa
import sys
import os.path

@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

@ -165,6 +165,3 @@ texinfo_documents = [
author, 'Towncrier', 'One line description of project.',
'Miscellaneous'),
]

@ -93,4 +93,4 @@ For example:
[[tool.towncrier.type]]
directory = "chore"
name = "Other Tasks"
showcontent = false
showcontent = false

@ -5,7 +5,7 @@ from setuptools import setup, find_packages
# If incremental is not present then setuptools just silently uses v0.0.0 so
# let's import it and fail instead.
import incremental
import incremental # noqa
setup(

@ -1 +1 @@
Move docs too master branch and document custom fragment types.
Move docs too master branch and document custom fragment types.

@ -1,2 +1,2 @@
Added support to tables in toml settings, which provides a more intuitive
way to configure custom types.
way to configure custom types.

@ -670,7 +670,7 @@ class TestCli(TestCase):
)
self.assertEqual(0, result.exit_code, result.output)
with open("NEWS.rst", "r") as f:
with open("NEWS.rst") as f:
output = f.read()
self.assertEqual(

@ -1,15 +1,8 @@
[tox]
envlist = cov-erase, flake8, pre-commit, {pypy37,pypy38,py37,py38,py39,py310}-tests, flake8, check-manifest, check-newsfragment, cov-report
envlist = cov-erase, pre-commit, {pypy37,pypy38,py37,py38,py39,py310}-tests, flake8, check-manifest, check-newsfragment, cov-report
isolated_build=true
skip_missing_envs = true
[testenv:flake8]
skip_install = True
deps =
flake8
commands =
flake8 src/towncrier/
[testenv:pre-commit]
skip_install = True
deps = pre-commit

Loading…
Cancel
Save