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

Formatting PR #9

Merged
merged 105 commits into from
Feb 19, 2024
Merged

Formatting PR #9

merged 105 commits into from
Feb 19, 2024

Conversation

Younis-Ahmed
Copy link
Contributor

Formatting PR Summary

This PR provides several fixes and improvements:

  • Fixes PEP8 and Docstring Formatting #8 and partially fixes Codebase Formatting and Test Suite Proposal #5: Improved the formatting of the codebase to adhere to PEP8 standards. This includes changes such as fixing indentation, removing unnecessary whitespace, and improving the readability of the code.
  • Added error logs: Introduced a new errors_log directory to track pylint linting reports. This will help us maintain a high-quality codebase and quickly identify any areas that need improvement. added the directory and pylintrc to MANIFEST.in to exclude. upon compilation for pypi
  • Fixes Duplication functions found in betty_fixer and betty_handler modules. #7: Removed the betty_handler.py module. The function inside this module was a duplication.
  • Pushing code rating: The codebase overall quality has been enhanced from ~6± to ~9±.

  • Note: Perfect code rating 10 was achieved by artificially utilizing pylint disabled for certain errors and can be found by parsing the codebase with pylint inside the package For future contributions.

  • CI enhancements: Added github action to run pylint && pycodestyle linter upon push or PR, Also added Python matrix <-- [3.8, 3.9, 3.10]

Major changes Made

@be-great
Copy link
Collaborator

be-great commented Feb 18, 2024

@Younis-Ahmed can you document the commands you are using to run the test cases on the errors_log folder and the pylint.
I really like this idea "Continuous integration for linting upon push and pull request." you really did a good job. 🙏

@Younis-Ahmed
Copy link
Contributor Author

@be-great Thanks 🙏

Here you go!

pylint "$file" --reports=y -f parseable >> $outputfile

Please note that this is code snippet is part of a bash script i made to integrate into my workflow, it replaces the need to use pylint command directly. Instead, I use the script as it logs all attempts of invoking pylint

The rationale behind this workflow is to log everything that happens within the linting scope, with the integration of my PR the github action will reject merging all code that is not conforming to PEP8 rules. Leaving holes in the project memory.

CI workflow

stateDiagram-v2
   [*] --> NewPR
   NewPR --> linting_action: triggered
   linting_action --> isValid: pylint and pycodestyle validation
   isValid --> yes: Merge
   isValid --> no: exit 1
   no --> Terminated
   yes --> Terminated
   Terminated--> [*]
Loading

If you want this level of logs records in your project let me know and i will add the script <-- This can be enforced at the readme contribution section

@be-great
Copy link
Collaborator

Here you go!

pylint "$file" --reports=y -f parseable >> $outputfile

Okay, I will test it, and notify you.

@be-great be-great merged commit 74d5540 into Moealsir:main Feb 19, 2024
3 checks passed
Copy link
Contributor Author

@Younis-Ahmed Younis-Ahmed left a comment

Choose a reason for hiding this comment

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

merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants