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 issue #129 pep-8 sorted imports #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

clach04
Copy link
Contributor

@clach04 clach04 commented Nov 2, 2022

Used isort to automate. Now have per line imports following pep8 order. Remove duplicate datetime import.

Used isort to automate. Now have per line imports following pep8 order.
Remove duplicate datetime import.
Copy link

@samuelallan72 samuelallan72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'm wondering if it would be worthwhile to add a Makefile and a 'fix' or 'fmt' target to run isort, just for future reference and if we want to make it easy to enforce a consistent style in the future?

@clach04
Copy link
Contributor Author

clach04 commented Nov 3, 2022

Hmmm, easy answer is; your project, your rules ;-)

You might want to consider looking at:

  • black (very opinionated formatter)
  • isort (as I used in this instance, this is actually my first time using this in anger, I was very impressed with it)
  • pyflakes (or some other linting tool)

I don't have that many large projects so I've not invested much time into automation, ideas to check out:

Right now my advice would be don't rush into anything.

@samuelallan72
Copy link

Yep that's fair, thanks. 👍

Perhaps for now, a Makefile target that runs the isort command you used to generate these changes - then at least we have a record and can keep it consistent.

@lostways
Copy link
Contributor

lostways commented Jun 6, 2023

If this is still being considered..... I agree with using a workflow/pre-commit hook to automate formatting if you want to keep it standard. black is industry standard in terms of formatting but would probably change a lot in the codebase.

However, for now, instead of a Makefile you might want to add isort as a dependency and some docs on how to run it before you add any more automated or abstracted way to do it.

It would be best to keep this PR separate from any PR that implements automation. There isn't a lot of development going on so automation isn't an immediate need. Implementing it can be complex and would probably deserve it's own PR.

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.

3 participants