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

mavgen_python: Reformat output #662

Merged
merged 8 commits into from
May 16, 2022
Merged

mavgen_python: Reformat output #662

merged 8 commits into from
May 16, 2022

Conversation

alehed
Copy link
Contributor

@alehed alehed commented Apr 20, 2022

This PR is the first in a series to add a python3 target based off of #654, but in a way that doesn't increase the maintenance burden.

Right now the generated python code contains many instances of inconsistent indentation (a mix of 4 spaces, 8 spaces and 2 spaces), this changes all the indentation to 4 spaces.

This contains the following formatting changes:

  • The code itself is slightly reformatted for more space
  • Whenever possible, double quotes are used instead of single quotes (in the code and the output)
  • The output code consistently uses 4 spaces of indentation and doesn't produce whitespace linter errors
  • The enum in the output code is one big literal instead of being constructed

There is also the option to use more vertical space in long lists and parameters, but I'm not sure if this is desired.

This PR is probably the most controversial. I'm happy to adjust parts of it for it to get merged. Let me know what you think.

@alehed
Copy link
Contributor Author

alehed commented Apr 21, 2022

The following gist shows a comparison between the generated code before and after: https://gist.github.com/alehed/ab70682d44fe4149a974a79d7f16d802

@alehed
Copy link
Contributor Author

alehed commented May 13, 2022

@khancyr I added a CI check. Is this what you were thinking about? Also can you approve the CI workflow?

@tridge tridge merged commit c215878 into ArduPilot:master May 16, 2022
@alehed alehed deleted the reformat_output branch May 17, 2022 06:25
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.

None yet

2 participants