-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pre-commit for formatting, liniting and code checking. #302
Conversation
Remove strictness for yamllint to prevent "Failed" precommit status on too long lines. Remove width restriction on yamlfmt to prevent breaking of long lists which are then indented "inconsistently" according to yamllint. (Arbitrary changes which seem reasonable at the moment; mainly caused by inconsistencies between pyaaml and ruamel.yaml).
Line length according to black (80 characters + <=10%).
Option "braces = disable" removes validity of "{}" of entries in yaml file, but those are necessary for the configuration-> manual ignore required.
(Run `pre-commit run --all-files` )
What I also use for linopy: Isort sorts imports of packages
codespell checks for spelling errors in comments and docstrings
|
…ironment.yaml. glpk and ipopt should be installed via conda, due to indentation mismatch they were installed via pip (which failed).
Added. I had to exclude a regex for all CAPITAL CASE words for codespell, as it complained about the code strings |
Re question what to add: I like under
|
Added, but with 2 MB as a limit. Our pictures in the documentations are sometimes larger than 1 MB. |
Fair enough 🔢 |
This is now hot again @FabianHofmann @euronion. |
Given that we already have a large number of commits in the |
add min part load for FT and methanolisation via p_min_pu
Closes #242 .
Closes #239 .
Changes proposed in this Pull Request
Add checks, formatters and linters using
pre-commit
to the repository.Especially includes:
black
formatting for Pythonyaml
filesREUSE
check for FSFE REUSE complianceQuestion:
pre-commit
be added to theenvironment.yaml
? --> NoTODOs:
pre-commit
encouragement (PR template + docu fromatlite
as template?)pep8
recommendation from documentationgit blame
Checklist
envs/environment.yaml
andenvs/environment.docs.yaml
.config.default.yaml
,config.tutorial.yaml
, andtest/config.test1.yaml
.doc/configtables/*.csv
and line references are adjusted indoc/configuration.rst
anddoc/tutorial.rst
.doc/release_notes.rst
is amended in the format of previous release notes.