-
Notifications
You must be signed in to change notification settings - Fork 437
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.yaml #769
Conversation
d97da4e
to
9516c39
Compare
Hey @r-barnes, this sounds like a great idea. Let me bring it up in our next team meeting, and I'll let you know what they think. |
@connernilsen has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
9516c39
to
f82843b
Compare
@connernilsen has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@connernilsen merged this pull request in 4f8e05b. |
This hook is not working due to failure of $ pre-commit
[INFO] Installing environment for https://github.com/facebook/pyre-check.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/home/eggplants/.cache/pre-commit/repo6fvdksto/py_en
v-python3.9/bin/python', '-mpip', 'install', '.')
return code: 1
stdout:
Processing /home/eggplants/.cache/pre-commit/repo6fvdksto
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
stderr:
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
error: Multiple top-level packages discovered in a flat-layout: ['api', 'stubs', 'source', 'client', 'pysa_
tutorial', 'pyre_extensions'].
To avoid accidental inclusion of unwanted files or directories,
setuptools will not proceed with this build.
If you are trying to create a single distribution with multiple packages
on purpose, you should not rely on automatic discovery.
Instead, consider the following options:
1. set up custom discovery (`find` directive with `include` or `exclude`)
2. use a `src-layout`
3. explicitly set `py_modules` or `packages` with a list of names
To find more information, look for "package discovery" on setuptools docs.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Check the log at /home/eggplants/.cache/pre-commit/pre-commit.log
- id: pyre-check-docker
name: Run pyre check with docker
language: docker_image
entry: ghcr.io/facebook/pyre-check:X.Y.Z Creating Dockerfile, building and publishing image to a container registry such as ghcr.io are needed. SampleHook configuration file: GitHub workflow for building and publishing: Published image: |
Are there additional steps in order to be able to use pyre as a pre-commit hook? It seems that even if the issues raised by @eggplants are addressed, the pre-commit framework requires the library to be able to process a list of files which isn't something Pyre appears to be able to do. |
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit install
pre-commit run
Summary
This should make the Pyre compatible as a pre-commit tool
Test Plan