Skip to content

#64 - Introduce the pylint into project #65

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

Merged
merged 17 commits into from
Sep 2, 2024

Conversation

miroslavpojer
Copy link
Collaborator

@miroslavpojer miroslavpojer commented Aug 28, 2024

  • Added pylint config. Reused config from living-documentation-generator repository as approved settings.
  • Add section in README.md describing how to use pylint.
  • Add new library dependency into requirements.txt
  • Updated test.yml file (renamed from build.yml) to run two jobs: unit test and static code analysis. Job for static code analysis contains check for minimal required scode == 9.5.
  • Formatting of repository code will be part of following Issue. Check is failing now.

Closes #64

- Added pylint config. Reused config from living-documentation-generator repository as approved settings.
- Add section in README.md describing how to use pylint.
- Add new library dependency into requirements.txt
- Updated test.yml file (renamed from build.yml) to run two jobs: unit test and static code analysis. Job for static code analysis contains check for minimal required scode == 9.5.
- Formatting of repository code will part of following Issue.
@miroslavpojer miroslavpojer self-assigned this Aug 28, 2024
@miroslavpojer
Copy link
Collaborator Author

Release notes:

  • Introduces pylint support & CI check job to fail when not reached limit (9.5/10) score.

@miroslavpojer miroslavpojer marked this pull request as draft August 28, 2024 12:07
@miroslavpojer miroslavpojer marked this pull request as ready for review August 28, 2024 13:02
Copy link

@MobiTikula MobiTikula left a comment

Choose a reason for hiding this comment

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

I would suggest to improve .pylintr file with ignoring method documentation for getter methods. It is not a substantial documentation. Less is more.

  • Improve your Pylint score up to 9.5 or higher.

@miroslavpojer
Copy link
Collaborator Author

I would suggest to improve .pylintr file with ignoring method documentation for getter methods. It is not a substantial documentation. Less is more.

  • Improve your Pylint score up to 9.5 or higher.

Implemented in commit f4b1058.

- Update of Readme and fix the TOC.
Copy link

@MobiTikula MobiTikula left a comment

Choose a reason for hiding this comment

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

I have several thoughts about Pylint check implementation

  • you use a lot of constants all over the project, but having only 5 of them in the utils/constants.py. Does it have any deeper meaning? I think that is the same pattern like I had in liv-doc: see the comment from Laco: Refactoring/13 documentation and formatting living-doc-generator#30 (comment)
  • you often use # pylint: disable=, but even in scenarios, where I think it is suggesting improving the code. IMOP you are overusing classes, like the constants class etc. I had the same issue with my pylint implementation and after removing the unnecessary classes the code got much better.
  • since you use so many pylint disabling constants, maybe you should modify the pylint settings. You can ignore some error logs even for the whole files (like test files). The code with so many disabling comments does not look the best.
  • There are some formatting issues, BUT don't worry. We have BLACK tool!:)

@miroslavpojer
Copy link
Collaborator Author

I have several thoughts about Pylint check implementation

  • you use a lot of constants all over the project, but having only 5 of them in the utils/constants.py. Does it have any deeper meaning? I think that is the same pattern like I had in liv-doc: see the comment from Laco: Refactoring/13 documentation and formatting living-doc-generator#30 (comment)
  • you often use # pylint: disable=, but even in scenarios, where I think it is suggesting improving the code. IMOP you are overusing classes, like the constants class etc. I had the same issue with my pylint implementation and after removing the unnecessary classes the code got much better.
  • since you use so many pylint disabling constants, maybe you should modify the pylint settings. You can ignore some error logs even for the whole files (like test files). The code with so many disabling comments does not look the best.
  • There are some formatting issues, BUT don't worry. We have BLACK tool!:)
  • Contants accepted and solved.
  • Could you identify other location to improved instead of usage pylint disable?

Copy link

@MobiTikula MobiTikula left a comment

Choose a reason for hiding this comment

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

As requested, I added some suggestions, how code can be improved with Pylint advices. IMOP all pylint warnings should be tried to be solved at the first place. If the improvement is affecting the logic in a bad way, than there is option to disable the warning. But I try to solve the issue first and I am satisfied with the benefits. I don't care a lot about the aesthetics of the code, since I can format it later with other tools.

@@ -18,65 +18,62 @@
import logging
import os
import sys
from typing import Optional

Choose a reason for hiding this comment

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

Not used import.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

@MobiTikula MobiTikula self-requested a review September 2, 2024 10:17
@miroslavpojer miroslavpojer merged commit 41228bf into master Sep 2, 2024
3 checks passed
@miroslavpojer miroslavpojer deleted the feature/64-Introduce-the-pylint-into-project branch September 2, 2024 10:20
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.

Introduce the pylint into project
2 participants