Skip to content
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

Fix pre-commit file #269

Merged
merged 6 commits into from Apr 19, 2024
Merged

Fix pre-commit file #269

merged 6 commits into from Apr 19, 2024

Conversation

trevorb1
Copy link
Collaborator

@trevorb1 trevorb1 commented Apr 11, 2024

Closes #268

Changes proposed in this Pull Request

In this PR I have finished setting up pre-commit to actually perform our formatting/linting! Fixes include:

  • Fix file exclusions
  • Get rid of default pyupgrade if favour of this pyupgrade
  • Get rid of reorder-inputs and move to isort. This is due to a conflict between reorder-inputs and Black. See this issue thread on the Black repo. This does require the addition of an .isort.cfg file

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • Changed dependencies are added to envs/environment.yaml.
  • Changes in configuration options are added in all of config.default.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv.

@trevorb1
Copy link
Collaborator Author

@ktehranchi; this update will change quite a few files, but mainly just the import statements. If you have a large PR you are working on, can you please check if this will slot in okay before I merge it? Just want to try to avoid merge conflicts! :)

Maybe the easiest way to do this will be (but this is def just a guess):

  • Pull in the newest .pre-commit-config.yaml (and .isort.cfg) files
  • Install pre-commit with pip install pre-commit
  • Run all file with pre-commit run --all-files

Or the other options:

  • I can wait to merge this until you have merged your changes in
  • I can merge this if you feel confident the import changes will be easy to manage on your end. Then we can revert if necessary.

@trevorb1 trevorb1 merged commit dff50ba into PyPSA:master Apr 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finish setting up pre-commit
1 participant