Skip to content

Commit

Permalink
Merge pull request #381 from hynek/pre-commit_ci
Browse files Browse the repository at this point in the history
Bootstrap pre-commit.ci
  • Loading branch information
adiroiban authored Apr 11, 2022
2 parents 2e2208d + d849925 commit 3b52db7
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 24 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ apidocs/
.coverage.*
.vscode
.idea
.python-version
.python-version
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion admin/check_tag_version_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
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}'")
Expand Down
1 change: 1 addition & 0 deletions bin/towncrier
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /usr/bin/env python3
# flake8: noqa

import sys
import os.path
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 0 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,3 @@
author, 'Towncrier', 'One line description of project.',
'Miscellaneous'),
]



2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ For example:
[[tool.towncrier.type]]
directory = "chore"
name = "Other Tasks"
showcontent = false
showcontent = false
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# 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(
Expand Down
1 change: 0 additions & 1 deletion src/towncrier/newsfragments/330.misc
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

2 changes: 1 addition & 1 deletion src/towncrier/newsfragments/367.doc.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Move docs too master branch and document custom fragment types.
Move docs too master branch and document custom fragment types.
2 changes: 1 addition & 1 deletion src/towncrier/newsfragments/369.feature.rst
Original file line number Diff line number Diff line change
@@ -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.
Empty file.
2 changes: 1 addition & 1 deletion src/towncrier/test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ def test_bullet_points_false(self):
)

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(
Expand Down
9 changes: 1 addition & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 3b52db7

Please sign in to comment.