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

Improve developer workflow with pre-commit #351

Merged
merged 5 commits into from Sep 4, 2023
Merged

Improve developer workflow with pre-commit #351

merged 5 commits into from Sep 4, 2023

Conversation

btjanaka
Copy link
Member

@btjanaka btjanaka commented Sep 2, 2023

Description

Pre-commit is a highly popular framework for installing pre-commit hooks into git projects. This PR adds pre-commit to improve quality-of-life for developers — with pre-commit, developers can easily enforce our style when contributing to pyribs. Adding pre-commit also necessitated fixing files which threw formatting and linting errors.

TODO

  • Add pre-commit to CI
  • Run YAPF on files and make changes
  • Run prettier on Markdown/YAML files and make changes
  • Update pylint config — previously, we threw many warnings when running the latest pylint because our pylint config included features only intended for Python 2 compatibility
    • Allow __init__ methods to not have docstrings
  • Install pytest in the CI so the tests can import it during the pylint check

Questions

Status

  • I have read the guidelines in CONTRIBUTING.md
  • I have formatted my code using yapf
  • I have tested my code by running pytest
  • I have linted my code with pylint
  • I have added a one-line description of my change to the changelog in HISTORY.md
  • This PR is ready to go

@btjanaka btjanaka changed the title Add pre-commit Improve developer workflow with pre-commit Sep 2, 2023
Copy link
Member Author

@btjanaka btjanaka left a comment

Choose a reason for hiding this comment

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

@yutaizhou took a look and confirmed the setup instructions in contributing.md work

@btjanaka btjanaka merged commit 8f5b8c0 into master Sep 4, 2023
18 checks passed
@btjanaka btjanaka deleted the pre-commit branch September 4, 2023 18:43
@btjanaka btjanaka mentioned this pull request Sep 9, 2023
6 tasks
btjanaka added a commit that referenced this pull request Sep 9, 2023
## Description

<!-- Provide a brief description of the PR's purpose here. -->

CONTRIBUTING.md was amended in #351 to state that we install pre-commit
in the dev dependencies, but we forgot to modify the dependencies in
#351.

## TODO

<!-- Notable points that this PR has either accomplished or will
accomplish. -->

## Questions

<!-- Any concerns or points of confusion? -->

## Status

- [x] I have read the guidelines in

[CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md)
- [x] I have formatted my code using `yapf`
- [x] I have tested my code by running `pytest`
- [x] I have linted my code with `pylint`
- [x] I have added a one-line description of my change to the changelog
in
      `HISTORY.md`
- [x] This PR is ready to go
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

1 participant