Skip to content

Commit

Permalink
Merge branch 'adopt_black_#402'
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaiarocci committed Jun 22, 2018
2 parents 3062ee4 + 4f0a7b7 commit f4b78f8
Show file tree
Hide file tree
Showing 27 changed files with 1,643 additions and 1,236 deletions.
16 changes: 8 additions & 8 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<!--
This issue tracker is dedicated to bugs and feature requests.
**IT IS NOT SUPPOSED FOR ANY USAGE RELATED QUESTIONS.**
(sorry for that loud but necessary statement.)
**IT IS NOT SUPPOSED FOR ANY USAGE RELATED QUESTIONS.**
(sorry for that loud but necessary statement.)
Stack Overflow is the go-to place for general questions and general how-tos. On
SO, questions tagged with the 'cerberus' tag are actively monitored by the
project author, contributors and users. If consultancy there leads you to the
conclusion that the documentation should be improved, it is a valid bug report
project author, contributors and users. If consultancy there leads you to the
conclusion that the documentation should be improved, it is a valid bug report
here.
When reporting a bug, please post a full code example and make it as simple as
possible. From your use-case throw everything out that is irrelevant to evoke
When reporting a bug, please post a full code example and make it as simple as
possible. From your use-case throw everything out that is irrelevant to evoke
the bug.
**It is mandatory to provide the information in the template below:**
Expand All @@ -23,7 +23,7 @@ Used Cerberus version / latest commit: …
- [ ] I have the capacity to improve the docs when my problem is solved.
- [ ] I have the capacity to submit a patch when a bug is identified.

- [ ] My question does not concern a practical use-case that I can't figure out
- [ ] My question does not concern a practical use-case that I can't figure out
to solve.

----
Expand All @@ -34,6 +34,6 @@ Used Cerberus version / latest commit: …

----

#### Bug report / Feature request
#### Bug report / Feature request

<!-- describe your issue here -->
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ _build

# Jetbrains
.idea

# my private cerberus playground
run.py
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/ambv/black
# TODO switch to 'stable' once --skip-string-normalization lands on it
rev: master
hooks:
- id: black
args: [--quiet, --safe, --skip-string-normalization]
python_version: python3.6
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- id: flake8
19 changes: 17 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
sudo: false
language: python
stages:
- linting
- test
cache: pip
python:
- 2.7
Expand All @@ -9,5 +12,17 @@ python:
- pypy
- pypy3
install: travis_retry pip install tox-travis
script:
- tox
script: tox --recreate

jobs:
include:
- stage: linting
python: '3.6'
env:
install:
- pip install pre-commit
- pre-commit install-hooks
before_script:
services:
script:
- pre-commit run --all-files
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Cerberus is developed and maintained by the Cerberus community. It was created
by Nicola Iarocci.
by Nicola Iarocci.

Core maintainers
~~~~~~~~~~~~~~~~
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Fixed

Improved
~~~~~~~~
- Reformat code to match Black code-style (`#402`_)
- Perform lint checks and fixes on staged files, as a pre-commit hook (`#402`_)
- Performm linting checks as CI first stage. On failure, do not run the test
suite (`#402`_).
- Change ``allowed`` rule to use containers instead of lists (`#384`_)
- Remove ``Registry`` from top level namespace (`#354`_)
- Remove ``utils.is_class``
Expand All @@ -46,6 +50,7 @@ Docs

.. _`#406`: https://github.com/pyeve/cerberus/issues/406
.. _`#404`: https://github.com/pyeve/cerberus/issues/404
.. _`#402`: https://github.com/pyeve/cerberus/issues/402
.. _`#389`: https://github.com/pyeve/cerberus/issues/389
.. _`#384`: https://github.com/pyeve/cerberus/issues/384
.. _`#382`: https://github.com/pyeve/cerberus/issues/382
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@ Making Changes
* Please avoid working directly on ``master`` branch.
* Make commits of logical units (if needed rebase your feature branch before
submitting it).
* Check for unnecessary whitespace with ``git diff --check`` before committing.
* Make sure your commit messages are in the `proper format`_.
* If your commit fixes an open issue, reference it in the commit message (#15).
* Make sure your code conforms to PEP8_.
* Make sure you have added the necessary tests for your changes.
* Run all the tests to assure nothing else was accidentally broken.
* Install and enable pre-commit_ (``pip install pre-commit``, then ``pre-commit
install``) to ensure styleguides and codechecks are followed. CI will reject
a change that does not conform to the guidelines.
* Don't forget to add yourself to AUTHORS_.

These guidelines also apply when helping with documentation (actually, for
typos and minor additions you might choose to `fork and edit`_).

.. _pre-commit: https://pre-commit.com/

Submitting Changes
------------------
* Push your changes to a topic branch in your fork of the repository.
Expand All @@ -62,10 +65,7 @@ you might want to check this excellent `Effective Guide to Pull Requests`_
.. _`new issue`: https://github.com/pyeve/cerberus/issues/new
.. _Fork: https://help.github.com/articles/fork-a-repo
.. _`proper format`: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
.. _help: https://help.github.com/
.. _`Effective Guide to Pull Requests`: http://codeinthehole.com/writing/pull-requests-and-other-good-practices-for-teams-using-github/
.. _`fork and edit`: https://github.com/blog/844-forking-with-the-edit-button
.. _`Pull Request`: https://help.github.com/articles/creating-a-pull-request


4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ implications.
- [ ] Objects from the `typing` module can be used as constraints for the
`type` rule. (#374)
- [ ] The `schema` rule only handles mappings, a new `itemrules` replaces the
part where `schema` tested items in sequences so far. There will be no
part where `schema` tested items in sequences so far. There will be no
backward-compatibility for schemas. (#385)
- [ ] The rules `keyschema` and `valueschema` are renamed to `keyrules` and
`valuerules`, backward-compatibility for schemas will be provided. (#385)
Expand All @@ -65,7 +65,7 @@ implications.
- [ ] The feature freeze gets lifted and the `CONTRIBUTING.rst` is updated
accordingly.
- [ ] The module `dataclasses` is implemented. This may get postponed 'til a
following minor release. (#397)
following minor release. (#397)

#### Undecided issues

Expand Down
2 changes: 1 addition & 1 deletion cerberus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
TypeDefinition.__name__,
Validator.__name__,
'schema_registry',
'rules_set_registry'
'rules_set_registry',
]
Loading

0 comments on commit f4b78f8

Please sign in to comment.