Skip to content

Support linting, formatting, etc through pre-commit #12187

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

Closed
paw-lu opened this issue Jun 8, 2020 · 3 comments
Closed

Support linting, formatting, etc through pre-commit #12187

paw-lu opened this issue Jun 8, 2020 · 3 comments
Labels
area-editor-* User-facing catch-all feature-request Request for new features or functionality

Comments

@paw-lu
Copy link

paw-lu commented Jun 8, 2020

Background

It's become pretty popular to use .pre-commit-config.yaml to define linting, type-checking, and autoformatting dependencies and processes in Python projects. Many projects go as far as to no longer specify flake8 dependencies in their requirements.txt/pyproject.tom/setup.py.

Unfortunately, it seems vscode-python does not play well with pre-commit.

When cloning a project, the most reliable approach I've found it to

  1. Parse the .pre-commit-config.yml for dependencies
  2. Manually create an environment with the linting dependencies
  3. Add the environment path manually to python.linting.pylintPath.

If anyone has a better workflow, I'd love to know!

Proposal

Support pre-commit as a linter, formatter, and type checker. Adding pre-commit as one of these would use pre-commit run to run the appropriate linting steps (e.g. pre-commit run flake8 --files).


Thanks for the project, I've really enjoyed the Python plugin!

@paw-lu paw-lu added triage-needed Needs assignment to the proper sub-team feature-request Request for new features or functionality labels Jun 8, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jun 8, 2020
@karthiknadig
Copy link
Member

Thank you for the suggestion! We have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision.

@paw-lu
Copy link
Author

paw-lu commented Jun 8, 2020

Thanks @karthiknadig !

@luabud luabud added needs PR needs proposal Need to make some design decisions area-editor-* User-facing catch-all and removed needs decision labels Jul 8, 2020
@luabud luabud assigned luabud and unassigned luabud Aug 12, 2020
@luabud luabud added needs spike Label for issues that need investigation before they can be worked on. and removed needs proposal Need to make some design decisions labels Aug 12, 2020
@brettcannon
Copy link
Member

Closing in favour of #10165 .

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2023
@github-actions github-actions bot removed the needs spike Label for issues that need investigation before they can be worked on. label Dec 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-editor-* User-facing catch-all feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants