Skip to content

The git pre-commit hook contradices itself and goes beyond the scope of the files to commit #7512

Closed as not planned
@carlos3dx

Description

@carlos3dx

Repository commit

e6d825e

Python version (python --version)

Python 3.9.1

Dependencies version (pip freeze)

absl-py==1.3.0
astunparse==1.6.3
beautifulsoup4==4.11.1
cachetools==5.2.0
certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
contourpy==1.0.5
cryptography==38.0.1
cycler==0.11.0
dill==0.3.5.1
fake-useragent==0.1.11
flatbuffers==22.9.24
fonttools==4.37.4
gast==0.4.0
google-auth==2.13.0
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
grpcio==1.49.1
h5py==3.7.0
idna==3.4
importlib-metadata==5.0.0
joblib==1.2.0
keras==2.10.0
Keras-Preprocessing==1.1.2
kiwisolver==1.4.4
libclang==14.0.6
lxml==4.9.1
Markdown==3.4.1
MarkupSafe==2.1.1
matplotlib==3.6.1
mpmath==1.2.1
networkx==2.8.7
ntlm-auth==1.5.0
numpy==1.23.4
oauthlib==3.2.1
opencv-python==4.6.0.66
opt-einsum==3.3.0
packaging==21.3
pandas==1.5.0
patsy==0.5.3
pbr==5.10.0
Pillow==9.2.0
pip==21.3.1
ply==3.11
projectq==0.8.0
protobuf==3.19.6
psutil==5.9.2
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
pyparsing==3.0.9
python-dateutil==2.8.2
pytz==2022.4
qiskit==0.39.0
qiskit-aer==0.11.0
qiskit-ibmq-provider==0.19.2
qiskit-terra==0.22.0
requests==2.28.1
requests-ntlm==1.1.0
requests-oauthlib==1.3.1
retworkx==0.12.0
rsa==4.9
rustworkx==0.12.0
scikit-fuzzy==0.4.2
scikit-learn==1.1.2
scipy==1.9.2
setuptools==60.2.0
six==1.16.0
sklearn==0.0
soupsieve==2.3.2.post1
statsmodels==0.13.2
stevedore==4.0.1
symengine==0.9.2
sympy==1.11.1
tensorboard==2.10.1
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow==2.10.0
tensorflow-estimator==2.10.0
tensorflow-io-gcs-filesystem==0.27.0
termcolor==2.0.1
texttable==1.6.4
threadpoolctl==3.1.0
tk==0.1.0
tweedledum==1.1.1
tweepy==4.10.1
typing_extensions==4.4.0
urllib3==1.26.12
websocket-client==1.4.1
websockets==10.3
Werkzeug==2.2.2
wheel==0.37.1
wrapt==1.14.1
xgboost==1.6.2
yulewalker==0.1.1
zipp==3.9.0

Expected behavior

When executing the pre-commit hook it only should only focus on the files that are being committed and ignore the ones in fit ignored folder like env.

Type hinting with typing library should be respected.

Actual behavior

When executing the pre-commit hook the file formatter complains about files that are not going to be committed and are in an ignored folder, for example, env.
Captura de Pantalla 2022-10-22 a las 14 06 44

Also if a function has type hinting from typing, it converts foo:List[str] to foo:list[str], and later complains that it is not subscriptable and also for the the unused import from typing import List cause the type hinting is not longer using the imported one. But if you don't do type hinting, the suggested hint includes the ones from typing

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions