Skip to content

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

Closed as not planned
Closed as not planned

Description

@paw-lu

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!

Activity

  1. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jun 8, 2020
  2. karthiknadig commented on Jun 8, 2020

    @karthiknadig
    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.

  3. paw-lu commented on Jun 8, 2020

    @paw-lu
    Author
  4. added
    needs spikeLabel for issues that need investigation before they can be worked on.
    and removed
    needs proposalNeed to make some design decisions
    on Aug 12, 2020
  5. brettcannon commented on Dec 18, 2023

    @brettcannon
    Member

    Closing in favour of #10165 .

  6. removed
    needs spikeLabel for issues that need investigation before they can be worked on.
    on Dec 18, 2023
  7. locked as resolved and limited conversation to collaborators on Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-editor-*User-facing catch-allfeature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions