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

Pylint fixes #159

Merged
merged 23 commits into from
Apr 14, 2021
Merged

Pylint fixes #159

merged 23 commits into from
Apr 14, 2021

Conversation

MuellerSeb
Copy link
Member

@MuellerSeb MuellerSeb commented Apr 8, 2021

... I've done it. Pylint is a pain, but a good one.

I created a setup for Pylint in pyproject.toml that should warn us about bad practice. I added a new stage in CI to check pylint.

Certain Pylint rules are disabled per file, where it makes sence (at least for me).

It helped me figure out all of the circular imports (see #24). Especially the matplotlib imports are now in a try block and later on deferred.

All remaining pylint warnings were sorted out here.

@MuellerSeb MuellerSeb self-assigned this Apr 8, 2021
@MuellerSeb MuellerSeb added CI/CD Refactoring Code-Refactoring needed here labels Apr 8, 2021
@MuellerSeb MuellerSeb added this to the 1.3 milestone Apr 8, 2021
@MuellerSeb MuellerSeb linked an issue Apr 8, 2021 that may be closed by this pull request
@MuellerSeb
Copy link
Member Author

@LSchueler this is ready for review.

Copy link
Member

@LSchueler LSchueler left a comment

Choose a reason for hiding this comment

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

I just had a very very brief look at this PR. Some changes I could not comprehend so quickly, but most of them look pretty harmless.
Maybe it would be helpful to have one central file (some source code file) where the pylint disabling codes are summarized or has the documentaion gotten better over time? - The last time I was setting the linter, it was a real pain to find the correct codes.
Actually, I think I would prefer a description on why each setting was made for each file. I'm just not sure how cluttered the files would be.

But anyway, I'm really curious to see what the Linter will complain about in my future code :-)

gstools/field/base.py Show resolved Hide resolved
@MuellerSeb
Copy link
Member Author

@LSchueler there is this Project: https://vald-phoenix.github.io/pylint-errors/ where the error-codes are documented quite well. I added a section in CONTRIBUTING.md about the occasionally disabled pylint checks. Hope you like it.

@LSchueler
Copy link
Member

@LSchueler there is this Project: https://vald-phoenix.github.io/pylint-errors/ where the error-codes are documented quite well. I added a section in CONTRIBUTING.md about the occasionally disabled pylint checks. Hope you like it.

That's great, I like the summary and also that you can find it in CONTRIBUTING.md.

@MuellerSeb MuellerSeb merged commit 89c3794 into develop Apr 14, 2021
@MuellerSeb MuellerSeb deleted the pylint_fixes branch April 14, 2021 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Refactoring Code-Refactoring needed here
Projects
None yet
Development

Successfully merging this pull request may close these issues.

At risk of circular imports
2 participants