-
Notifications
You must be signed in to change notification settings - Fork 192
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
Remove all files from the pre-commit exclude list #4196
Conversation
814ba36
to
4ed8cfc
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4196 +/- ##
===========================================
+ Coverage 79.11% 79.16% +0.06%
===========================================
Files 467 468 +1
Lines 34492 34463 -29
===========================================
- Hits 27284 27280 -4
+ Misses 7208 7183 -25
Continue to review full report at Codecov.
|
4ed8cfc
to
ccd4140
Compare
8e2ff02
to
e2a183b
Compare
@ramirezfranciscof and @chrisjsewell this bad boy is ready to go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👌
To anyone reading this Note that this should not be merged! |
That's fantastic @sphuber :-) One small question: I notice that you moved (in a previous PR) the pylint hook from P.S. I'm curious - did removing the exclude list surface any bugs? |
Combination of OCD and procrastination is one heck of a drug ;)
As you said, we need to run this with
Yes, plenty! Mostly in the data plugins. They are under tested and are some of the oldest code in |
Perhaps I'm wrong, but I believe the version (and executable) of pylint that you are using is the one installed by the Otherwise, how are they mixing the two python environments?
This point I fully support, i.e. I'm all for moving linters, formatters etc. into separate environments where we can. |
yeh pretty sure thats the case
Just in case you didn't know, you can get pre-commit to install additional packages into its environment with: https://pre-commit.com/#config-additional_dependencies. But thats probably not an adequate cure for the |
e2a183b
to
cd52368
Compare
.pre-commit-config.yaml
Outdated
- repo: https://github.com/PyCQA/pylint | ||
rev: pylint-2.5.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
were we going to move this into the local repo, as suggested by @ltalirz ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then we are back to the situation where we have to pin an exact version which will collide with any other projects you might have in the same virtual env. Is there no way to address this? I am not sure if this current solution actually allowed for this or if it had the same limitation and I just never noticed the collision
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still are in this situation - the only difference being that now we create an additional virtual environment that is never used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but as we discussed, I'm under the impression that, because of language: system
, it is already using the virtual env version of the package not the one that is installed in the pre-commit env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to use the one in the pre-commit env, you would have to either ignore errors regarding dependency installs, or also install them dependencies into the pre-commit environment, using https://pre-commit.com/#config-additional_dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrisjsewell not sure whether you replied to my comment or seb's - anyhow I did mean we create an additional pre-commit environment that is never used, i.e. we are saying the same thing.
As for your following comment, I don't think either of those are viable solutions, i.e. we can just move the hook back under local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved it back to local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure whether you replied to my comment or seb's
seb's
I don't think either of those are viable solutions
yep agree, just outlining the possible option 👍
Except for the documentation of course, which should remain excluded. Also move the `pylint` pre-commit hook back under `local`. The idea by putting it under the remote repos was to profit from the separate virtual environment that is created with the exact version specified in order to prevent clashes with requirements of other projects being developed in the same virtual environment. However, this approach leads to many spurious false positive import-errors because `pylint` cannot find all other third party dependencies. This can be fixed by specifying `language: system`, but this just forces the normal virtual environment to be used, rendering the whole point of using the remote repos moot.
cd52368
to
6c251bd
Compare
hooks: | ||
- id: pylint | ||
name: pylint | ||
language: system | ||
exclude: *exclude_files | ||
|
||
hooks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sphuber I didn't review this PR but I think you might have just disabled pylint there (hooks key used twice)...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configured hook doesn't actually work - you'll need to add
entry: pylint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the heads-up @ltalirz ! That is indeed a required key but normally that should raise a an error when the file is parsed
An error has occurred: InvalidConfigError:
==> File .pre-commit-config.yaml
==> At Config()
==> At key: repos
==> At Repository(repo='local')
==> At key: hooks
==> At Hook(id='pylint')
=====> Missing required key: entry
The bigger problem is that I accidentally defined the hooks
key twice. The first one, containing the pylint
config simply gets overridden, which is why pylint
is never actually run. I will create a PR to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See PR #4258
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bigger problem is that I accidentally defined the hooks key twice.
Right. That's what I wrote above, no? ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You did, but not in the original post. I read it on my email, which only ever send the first version. So you edit didn't show up Guess I could have noticed when responding here though :)
Fixes #2207 and fixes #3885