-
Notifications
You must be signed in to change notification settings - Fork 61
Set up pre-commit #289
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
Set up pre-commit #289
Conversation
See status in #279 (comment) - 14 errors left:
I will prepare the needed changes as PR(s) |
Rebased and fixed remaining mypy warnings. All tests in |
Updated to run |
@ondras12345 Would you consider to modify this PR such that it comes without the following parts (changes to OMCSession.py) - these clash with PR #295 such that there are big merge conflicts; both points (mypy warning and spelling fix) are included ... |
@syntron I could do that, but it would cause this PR to fail its CI test run. It might be better to get your PR merged first and let me handle the conflicts here. |
@syntron Btw, I tried to rebase #295 onto this PR, and it wasn't that bad. Only two of your commits had conflicts, and it was enough to just accept your version. Rebased branch: https://github.com/ondras12345/OMPython/tree/pr_295_rebased |
Rebased to fix merge conflict. |
@ondras12345 I think the renames would conflict with any changes in these classes; perhaps I should stop working on ModelicaSystem.py such that it could settle and you do not have so much work ... @adeas31 Do you know that the numbers at the ModelicaSystem methods refer to, i.e. |
That does not have any meaning just to count the number of API i guess which was done by a student as part of this thesis, so you can ignore that or you can even remove those numbers |
This should make workflow runs with linter errors fail faster.
Rebased, should be ready for review & merge. |
Proposal
pre-commit
is a nice tool that can be used to run various linters before each commit is made.This PR adds a
.pre-commit-config.yaml
with a basic set of checks and linters. It also fixes typos detected by the codespell check.Currently, the
mypy
check fails:I think @syntron has fixed at least some of these in his fork. I think we should wait for them to be merged before proceeding with this PR.
In the future, we could configure the github actions test workflow to also run linters via pre-commit.