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

Add pre-commit hooks & BSD 3-Clause license #206

Open
wants to merge 9 commits into
base: ros2-devel
Choose a base branch
from

Conversation

amalnanavati
Copy link
Contributor

@amalnanavati amalnanavati commented Dec 11, 2024

Description

This PR adds pre-commit hooks to this repository. This ensures consistent formatting and style throughout the repository. After the PR gets merged in, I'll be able to configure this repository to automatically run the pre-commit hooks on every PR.

Related PRs:

Testing procedure

Although in theory this should not change any functionality, we must check. Thus:

  • Start the demo in real: python3 src/ada_Feeding/start.py
  • Eat a whole bite, verify everything works as expected.
  • Start the demo in mock: python3 src/ada_Feeding/start.py --sim mock
  • Go through a whole bite, verify everything works as expected.

Before opening a pull request

  • pre-commit run --all-files
  • Run your code through pylint. pylint --recursive=y --rcfile=.pylintrc .. All warnings but fixme must be addressed.

Before Merging

  • Squash & Merge

@amalnanavati amalnanavati changed the title Add pre-commit hooks Add pre-commit hooks & BSD-Clause 3 license Dec 11, 2024
@amalnanavati amalnanavati changed the title Add pre-commit hooks & BSD-Clause 3 license Add pre-commit hooks & BSD 3-Clause license Dec 11, 2024
@amalnanavati
Copy link
Contributor Author

Note to reviewers: the main files to review are .pre-commit-config.yaml, the files in .github, and other new files. Other files were auto-modified by pre-commit hooks and have too many subtle spelling and formatting changes to reasonably review.

Copy link

@jjaime2 jjaime2 left a comment

Choose a reason for hiding this comment

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

Seems good, just want to make sure our READMEs are still readable after this PR gets merged.

ada_feeding/README.md Outdated Show resolved Hide resolved
@@ -1,5 +1,7 @@
#!/usr/bin/env python3
Copy link

Choose a reason for hiding this comment

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

For this and others, are there any instances where our existing stack calls Python files with ./? My understanding is this would be the only reason to have the shebang line present, so I'm wondering if it was done intentionally. Anecdotally, I haven't seen any such cases, but it's good to double check.

Copy link
Contributor Author

@amalnanavati amalnanavati Dec 11, 2024

Choose a reason for hiding this comment

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

ROS uses it for running Python nodes, I think to allow developers to specify python2 vs python3.

ada_feeding_perception/README.md Outdated Show resolved Hide resolved
Comment on lines +6 to +8
- main
- master
- ros2-devel
Copy link

@jjaime2 jjaime2 Dec 11, 2024

Choose a reason for hiding this comment

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

Are the others besides ros2-devel intended to catch the names of the production branches in other repositories, i.e. this pre-commit workflow will be applied to them as well if these pre-commit files are copied over?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, I'll copy this directly into the other repos.

(I don't think additional branches should impact runtime, since this repo doesn't have branches by those names)

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, my intent was to use this as a template for the other ADA repositories. I believe it doesn't add any extra computation to add these extra branches to the config file, since the branches don't exist.

@amalnanavati amalnanavati requested a review from jjaime2 December 12, 2024 00:48
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.

2 participants