mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Configure code checking and formatting tools
Checking - mypy - flake8 (which uses pyflakes and pycodestyle) Formatting - autopep8 - isort
This commit is contained in:
parent
8b76ebb3ef
commit
3efec53f51
25
DEV.md
25
DEV.md
@ -15,12 +15,14 @@ environment, run these commands in the same directory as this file:
|
||||
```
|
||||
$ python -m venv .venv
|
||||
$ . .venv/bin/activate
|
||||
$ pip install --editable .
|
||||
$ ./scripts/setup
|
||||
```
|
||||
|
||||
After this, you can use PFERD as if it was installed normally. Since PFERD was
|
||||
installed with `--editable`, there is no need to re-run `pip install` when the
|
||||
source code is changed.
|
||||
The setup script installs a few required dependencies and tools. It also
|
||||
installs PFERD via `pip install --editable .`, which means that you can just run
|
||||
`pferd` as if it was installed normally. Since PFERD was installed with
|
||||
`--editable`, there is no need to re-run `pip install` when the source code is
|
||||
changed.
|
||||
|
||||
For more details, see [this part of the Python Tutorial][venv-tut] and
|
||||
[this section on "development mode"][ppug-dev].
|
||||
@ -29,9 +31,22 @@ For more details, see [this part of the Python Tutorial][venv-tut] and
|
||||
[venv-tut]: <https://docs.python.org/3/tutorial/venv.html> "12. Virtual Environments and Packages"
|
||||
[ppug-dev]: <https://packaging.python.org/guides/distributing-packages-using-setuptools/#working-in-development-mode> "Working in “development mode”"
|
||||
|
||||
## Checking and formatting the code
|
||||
|
||||
To run a set of checks against the code, run `./scripts/check` in the repo's
|
||||
root directory. This script will run a few tools installed by `./scripts/setup`
|
||||
against the entire project.
|
||||
|
||||
To format the code, run `./scripts/format` in the repo's root directory.
|
||||
|
||||
Before committing changes, please make sure the checks return no warnings and
|
||||
the code is formatted.
|
||||
|
||||
## Contributing
|
||||
|
||||
When submitting a PR that adds, changes or modifies a feature, please ensure
|
||||
that the corresponding documentation is updated.
|
||||
that the corresponding documentation is updated as well. Also, please ensure
|
||||
that `./scripts/check` returns no warnings and the code has been run through
|
||||
`./scripts/format`.
|
||||
|
||||
In your first PR, please add your name to the `LICENSE` file.
|
||||
|
4
scripts/check
Executable file
4
scripts/check
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
mypy PFERD
|
||||
flake8 PFERD
|
4
scripts/format
Executable file
4
scripts/format
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
autopep8 --recursive --in-place PFERD
|
||||
isort PFERD
|
5
scripts/setup
Executable file
5
scripts/setup
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
pip install --upgrade pip setuptools
|
||||
pip install --editable .
|
||||
pip install --upgrade mypy flake8 autopep8 isort
|
Loading…
Reference in New Issue
Block a user