-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define the project toolset with pre-commit: - The Black formatter; - The style enforcer flake8; - The linter pylint. As described online [1], pylint raises a false positive about line continuation when using the black formatter. Also set the maximum line length to what black uses (88 characters). [1]: pylint-dev/pylint#289
- Loading branch information
Showing
7 changed files
with
839 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
repos: | ||
- | ||
repo: https://github.com/ambv/black | ||
rev: stable | ||
hooks: | ||
- | ||
id: black | ||
language_version: python3.6 | ||
- | ||
repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.7.4 | ||
hooks: | ||
- | ||
id: flake8 | ||
additional_dependencies: | ||
- flake8-docstrings | ||
- flake8-comprehensions | ||
- flake8-rst | ||
- pep8-naming | ||
- | ||
# Use the pylint mirror until issue with black is solved | ||
# (https://github.com/PyCQA/pylint/issues/289). | ||
repo: https://github.com/pre-commit/mirrors-pylint | ||
rev: v2.2.2 | ||
hooks: | ||
- id: pylint | ||
- | ||
repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.1.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: requirements-txt-fixer | ||
- id: check-yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
============= | ||
Mini Vouchers | ||
============= | ||
|
||
A minimal implementation of a voucher system. | ||
|
||
Usage | ||
----- | ||
|
||
TODO | ||
|
||
Installation | ||
------------ | ||
|
||
Simply install using the setup command, e.g. within a virtual environment: | ||
|
||
.. code-block:: shell | ||
$ virtualenv -p python3 venv | ||
$ . ./venv/bin/activate | ||
(venv)$ pip install . | ||
Requirements | ||
^^^^^^^^^^^^ | ||
|
||
Python 3.6 is required. | ||
|
||
Development | ||
^^^^^^^^^^^ | ||
|
||
The Python files are formatted with `Black`_ and linted with `flake8`_ and | ||
`pylint`_. | ||
A `pre-commit`_ hook is defined to automate the mundane work. | ||
|
||
To start developing, initialise the development environment and install the | ||
pre-commit hook with: | ||
|
||
.. code-block:: shell | ||
$ virtualenv -p python3 venv | ||
$ . ./venv/bin/activate | ||
(venv)$ pip install -r requirements-dev.txt | ||
(venv)$ pre-commit install | ||
License | ||
------- | ||
|
||
This project is free software and licensed under the GNU General Public License | ||
v3 or later. | ||
|
||
Authors | ||
------- | ||
|
||
`mini-vouchers` was written by `Borjan Tchakaloff <[email protected]>`_. | ||
|
||
Credits | ||
------- | ||
|
||
This package was created with `Cookiecutter`_ and is based on the | ||
`audreyr/cookiecutter-pypackage`_ and | ||
`kragniz/cookiecutter-pypackage-minimal`_ project templates. | ||
|
||
.. _`Black`: https://github.com/ambv/black | ||
.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter | ||
.. _`audreyr/cookiecutter-pypackage`: | ||
https://github.com/audreyr/cookiecutter-pypackage | ||
.. _`flake8`: https://gitlab.com/pycqa/flake8 | ||
.. _`kragniz/cookiecutter-pypackage-minimal`: | ||
https://github.com/kragniz/cookiecutter-pypackage-minimal | ||
.. _`pre-commit`: https://pre-commit.com | ||
.. _`pylint`: https://github.com/PyCQA/pylint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[FORMAT] | ||
|
||
# Maximum number of characters on a single line. | ||
max-line-length=88 | ||
|
||
# Disable C0330 as there are currently some false positives: | ||
# https://github.com/PyCQA/pylint/issues/289 | ||
disable=C0330 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-e . | ||
|
||
pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Copyright 2019 Borjan Tchakaloff | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
|
||
"""The setup script.""" | ||
|
||
from setuptools import setup, find_packages | ||
|
||
|
||
with open("README.rst") as readme_file: | ||
README = readme_file.read() | ||
|
||
|
||
setup( | ||
author="Borjan Tchakaloff", | ||
author_email="[email protected]", | ||
classifiers=[ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", | ||
"Natural Language :: English", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.6", | ||
], | ||
description="A minimal implementation of a voucher system.", | ||
license="GNU General Public License v3 or later", | ||
long_description=README, | ||
name="mini-vouchers", | ||
packages=find_packages(include=["mini_vouchers"]), | ||
python_requires="~=3.6", | ||
version="0.1.0", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[flake8] | ||
max-line-length=88 |