Skip to content

Conversation

@Gui-FernandesBR
Copy link
Member

Pull request type

  • Other (please describe): Linters!

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behavior

Pylint is the only linter adopted in our repo

New behavior

Flake8 is a simpler and faster linter that can be used to identify potential coding or formatting errors in a python file.

I added flake8 check to the CI right before the pylint checker.
A few errors pointed out by flake8 were not being detected by pylint, which really illustrates the importance of having at least 2 different linters running on production.

Breaking change

  • No

Additional information

  • I tested ruff as well, but it sounds too "experimental" to me. Maybe a few months we can rediscuss it.
  • Use make format to run isort and black.
  • Use make lint to run flake8 and pylint

Please run these commands before pushing to origin, the reviews will be much easier now.

@Gui-FernandesBR Gui-FernandesBR requested a review from a team as a code owner July 6, 2024 01:18
@Gui-FernandesBR Gui-FernandesBR added C.I. Continuous Integration (Workflows and actions) Refactor labels Jul 6, 2024
@Gui-FernandesBR
Copy link
Member Author

Flake8 is really faster! It will help us quite a lot.

image

@codecov
Copy link

codecov bot commented Jul 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.92%. Comparing base (6908414) to head (fd4941c).
Report is 6 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #631   +/-   ##
========================================
  Coverage    73.91%   73.92%           
========================================
  Files           70       70           
  Lines        10032    10032           
========================================
+ Hits          7415     7416    +1     
+ Misses        2617     2616    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Gui-FernandesBR Gui-FernandesBR force-pushed the dev/adds-flake8-as-pylint-fallback branch from 1addd37 to af9057b Compare July 6, 2024 03:46
@Gui-FernandesBR Gui-FernandesBR merged commit e953e0d into develop Jul 6, 2024
@Gui-FernandesBR Gui-FernandesBR deleted the dev/adds-flake8-as-pylint-fallback branch July 6, 2024 17:16
@Gui-FernandesBR Gui-FernandesBR changed the title DEV: adds flake8 as a pylint fallback Refactors the code to adopt flake8 Jul 20, 2024
@Gui-FernandesBR Gui-FernandesBR changed the title Refactors the code to adopt flake8 MNT: Refactors the code to adopt flake8 Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C.I. Continuous Integration (Workflows and actions) Refactor

Projects

No open projects
Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants