RocketPy icon indicating copy to clipboard operation
RocketPy copied to clipboard

MNT: Refactors the code to adopt pylint

Open Gui-FernandesBR opened this issue 1 year ago • 2 comments

We are going to officially adopt pylint in this repo.

Github Actions workflows erre updated:

  • The black/linter bot will no longer commit to this repo
  • When opening a PR, isort, black and pylint will be executed to verify if the code follows

I fixed many pylint errors, but it was a really hard task, quite time consuming. Therefore, I had to use pylint-silent to ignore some errors, those will be solved in the future, one by one.

You don't have to read all the files. Focus on the new github workflow files and the .pylintrc file

Gui-FernandesBR avatar Jun 14 '24 01:06 Gui-FernandesBR

We should add a fallback linter: another linter that is run after pylint to capture eventual errors not captured by the main linter.

I would say that ruff, the "yougest and fastest" player in the market right now, is our best candidate. I will let it for the next PR.

Flake8 would be the more "natural" option.

Maybe we could run flake8 AND also ruff.


@phmbressan I have fixed your comments. Please take in mind that I didnt't care too much about the errors threshold at this first time. I was more worried about getting everything to run.

Gui-FernandesBR avatar Jun 29 '24 04:06 Gui-FernandesBR

Codecov Report

Attention: Patch coverage is 78.69249% with 88 lines in your changes missing coverage. Please review.

Please upload report for BASE (develop@23fa110). Learn more about missing BASE report.

Files Patch % Lines
rocketpy/environment/environment_analysis.py 18.18% 27 Missing :warning:
rocketpy/simulation/flight.py 58.69% 19 Missing :warning:
rocketpy/motors/solid_motor.py 50.00% 7 Missing :warning:
rocketpy/prints/aero_surface_prints.py 77.77% 4 Missing :warning:
rocketpy/tools.py 42.85% 4 Missing :warning:
rocketpy/utilities.py 75.00% 4 Missing :warning:
rocketpy/environment/environment.py 86.95% 3 Missing :warning:
rocketpy/plots/compare/compare.py 40.00% 3 Missing :warning:
rocketpy/plots/rocket_plots.py 50.00% 3 Missing :warning:
rocketpy/plots/environment_analysis_plots.py 86.66% 2 Missing :warning:
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #621   +/-   ##
==========================================
  Coverage           ?   73.91%           
==========================================
  Files              ?       70           
  Lines              ?    10032           
  Branches           ?        0           
==========================================
  Hits               ?     7415           
  Misses             ?     2617           
  Partials           ?        0           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 29 '24 04:06 codecov[bot]