Skip to content

Commit

Permalink
Generalize linter calling via pre-commit (cookiecutter#1195)
Browse files Browse the repository at this point in the history
* enable chaining multiple linters via pre-commit tool.
* fixes several trailing newlines
* removes few incorrect +x modes on files
* adds few extra checks
* renames flake8 tox environment to 'lint' to avoid confusions
* fixes docs/conf.py style so we do not need more flake8 excludes
  • Loading branch information
ssbarnea authored and pydanny committed Jul 28, 2019
1 parent 1c547ee commit e59c34f
Show file tree
Hide file tree
Showing 16 changed files with 135 additions and 107 deletions.
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.8
hooks:
- id: flake8
additional_dependencies:
- flake8-black
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ language: python

matrix:
include:
- python: 3.7
env: TOXENV=lint
- python: 2.7
env: TOXENV=py27
- python: 3.5
Expand All @@ -15,8 +17,6 @@ matrix:
env: TOXENV=py37
- python: pypy
env: TOXENV=pypy
- python: 3.5
env: TOXENV=flake8

script: tox

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributing
============

Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.
little bit helps, and credit will always be given.

.. toctree::
:numbered:
Expand Down Expand Up @@ -155,7 +155,7 @@ Before you submit a pull request, check that it meets these guidelines:
feature to the list in README.rst.
3. The pull request should work for Python 2.7, 3.5, 3.6, 3.7, and PyPy on
AppVeyor and Travis CI.
4. Check https://travis-ci.org/audreyr/cookiecutter/pull_requests and
4. Check https://travis-ci.org/audreyr/cookiecutter/pull_requests and
https://ci.appveyor.com/project/audreyr/cookiecutter/history to ensure the tests pass for all supported Python versions and platforms.

Coding Standards
Expand Down Expand Up @@ -381,8 +381,8 @@ When you're processing the first change after a release, create boilerplate foll
Other changes:
* Description of the change, thanks to @contributor (#PR).
* Description of the change, thanks to @contributor (#PR).
.. _`@contributor`: https://github.com/contributor
Process: Accepting Template Pull Requests
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ Support This Project
--------------------

This project is run by volunteers. Shortly we will be providing means for organizations
and individuals to support the project.
and individuals to support the project.

Code of Conduct
---------------
Expand Down
2 changes: 1 addition & 1 deletion case_studies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ OpenStack uses several Cookiecutter templates to generate:
* `New tempest plugins`_

OpenStack_ is open source software for creating private and public clouds.

.. _OpenStack: http://www.openstack.org/
.. _`OpenStack compliant puppet-modules`: https://github.com/openstack/puppet-openstack-cookiecutter
.. _`Install guides`: https://github.com/openstack/installguide-cookiecutter
Expand Down
Loading

0 comments on commit e59c34f

Please sign in to comment.