Skip to content

Conversation

@cclauss
Copy link
Contributor

@cclauss cclauss commented Jun 18, 2025

Run flake8 in GitHub Actions but exclude third-party libraries
run: pipx run flake8 --exclude=MAVProxy/modules/lib

Once this has been running for a while, we can:

  • delete the remaining lines in the GitHub Action
  • delete scripts/run_flake8.py
  • remove all instances of AP_FLAKE8_CLEAN (git grep AP_FLAKE8_CLEAN)

ArduPilot/ardupilot#30288 (comment)

% flake8 --exclude=MAVProxy/modules/lib --disable-noqa --count

[ ... ]
5737

@rmackay9
Copy link
Contributor

The author ping'd me about this so I've added it to the EUDevCall. I'm not really qualified to review the PR

@cclauss cclauss force-pushed the run-flake8-directly branch 2 times, most recently from 965282f to 0b66935 Compare June 29, 2025 17:36
@tridge tridge force-pushed the run-flake8-directly branch from 0b66935 to 4e2dda7 Compare July 16, 2025 23:45
@cclauss cclauss force-pushed the run-flake8-directly branch 2 times, most recently from 3a0220a to 598c66e Compare August 20, 2025 12:42
submodules: 'recursive'

# Run flake8 but exclude third-party libraries
- run: pipx run flake8 --exclude=MAVProxy/modules/mavproxy_cesium,MAVProxy/modules/lib
Copy link
Contributor

Choose a reason for hiding this comment

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

We use --show-source in run_flake8 - any reason not to include it here?

Note that cesium is external, but most, if not all, of MAVProxy/modules/lib is ours to clean. Why did you choose to exclude it entirely here rather than add the # flake8: noqa?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, let's add --show-source. (Ruff has no such option, so I have gotten out of the practice of adding it.)

https://github.com/ArduPilot/MAVProxy/tree/master/MAVProxy/modules says:

mavproxy_cesium @ 78f7be3

Therefore, the code in MAVProxy/modules/mavproxy_cesium is a git submodule and is not in this repository.

Comment on lines 20 to 27
run: |
python -m pip install -U flake8
run: python -m pip install --upgrade flake8
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert these patches. They are unrelated to the topic of the PR and don't improve things.

Copy link
Contributor Author

@cclauss cclauss Aug 21, 2025

Choose a reason for hiding this comment

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

The switch from -U to --upgrade is a self-documenting readability change. As I have stated in other ArduPilot PRs, pip install currently has six different --u* command-line options, including the often-used --user.

% python3 -m pip install --help | grep "\-\-u"

@cclauss cclauss force-pushed the run-flake8-directly branch from 598c66e to 0e36f77 Compare August 21, 2025 08:01
@peterbarker
Copy link
Contributor

peterbarker commented Aug 21, 2025 via email

@cclauss cclauss force-pushed the run-flake8-directly branch from 0e36f77 to 18ab3b0 Compare August 21, 2025 10:56
@cclauss cclauss force-pushed the run-flake8-directly branch from 18ab3b0 to 3a2b8aa Compare August 21, 2025 11:00
@cclauss cclauss closed this Sep 3, 2025
@cclauss cclauss deleted the run-flake8-directly branch September 3, 2025 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants