Skip to content

update pre-commit conifiguration to avoid using the local escape hatch #71

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

Merged
merged 1 commit into from
Oct 21, 2021

Conversation

jkittner
Copy link
Contributor

using repo: local in pre-commit is considered an escape hatch, since it is not really portable and relies on the user to have the tools installed. pre-commit provides all the configuration options to be able to achieve what was previously done in bash, also much faster, since the files are now checked in parallel.

I also run autoupdate and had to fix one pylint import error, where afterwards black did some formatting, where I personally don't agree on, but it's at least consistent 😄

We might also consider enabling pre-commit.ci instead of running it in gha, it's a CI tool build for pre-commit which is really fast, auto fixes formatting issue e.g. if a PR comes in a an black was not used, it applies it and commits the changes for you. the autoupdate is run weekly (can be configured differently) and a PR is created if there are newer version of the linters or code formatters.

Since pre-commit seems to be the default in all adafruit repos this might be an option for the whole organization?

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Looks good! I hadn't seen the pre-commit.ci. That'd be good to bring up in our CircuitPython weekly meeting on Mondays. Thanks!

@tannewt tannewt merged commit 4a7932f into adafruit:main Oct 21, 2021
@jkittner jkittner deleted the update-pre-commit branch October 21, 2021 17:21
@jepler
Copy link
Contributor

jepler commented Oct 21, 2021

related:

@theendlessriver13 can you help us out with improving future pre-commit files over in cookiecutter-adafruit-circuitpython?

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 26, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.9.3 from 3.9.2:
  > add docs link to readme
  > Merge pull request adafruit/Adafruit_CircuitPython_GPS#71 from theendlessriver13/update-pre-commit

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.4.0 from 3.3.7:
  > add docs link to readme
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L0X#32 from caternuson/iss31
  > Globally disabled consider-using-f-string pylint check
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_Debouncer to 1.3.12 from 1.3.11:
  > add docs link to readme
  > Merge pull request adafruit/Adafruit_CircuitPython_Debouncer#31 from tjpeden/patch-1
  > Added pylint disable for f-strings in tests directory
  > Globally disabled consider-using-f-string pylint check
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.1.3 from 5.1.2:
  > add docs link to readme
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#94 from dhalbert/socket-arg-fix
  > Globally disabled consider-using-f-string pylint check

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.10.1 from 1.10.0:
  > add docs link to readme
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#82 from dhalbert/socket-arg-list
  > Globally disabled consider-using-f-string pylint check
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.

3 participants