Skip to content

Add Lint Trigger #393

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
wants to merge 1 commit into from

Conversation

drmathochist
Copy link

Pass a "trigger" string to the pyls_lint hook. This allows linter
hook implementations to decide whether to run or not, based on what
triggered linting. Useful for linters that are expensive to run,
so we don't want to run them on-change.

Since hook arguments are passed by keyword, this requires no changes
to existing local linter hook implementations.

Pass a "trigger" string to the `pyls_lint` hook.  This allows linter
hook implementations to decide whether to run or not, based on what
triggered linting.  Useful for linters that are expensive to run,
so we don't want to run them on-change.

Since hook arguments are passed by keyword, this requires no changes
to existing local linter hook implementations.
@palantirtech
Copy link
Member

Thanks for your interest in palantir/python-language-server, @drmathochist! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

Copy link
Contributor

@gatesn gatesn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it took me so long to get to this! Generally I like the approach, but I think the trigger strings should a) be called triggered_by, and b) be part of the hookspecs.py file in some sort of enum-style object (see the lsp.py file).

That way they're more obviously part of the hook-spec API.

@gatesn
Copy link
Contributor

gatesn commented Feb 15, 2019

Going to close this since #385 adds a "saved" argument to the lint hook. For expensive linters moving forwards I suggest we add an async_lint hook that passes a callback function. This way the linter can take as long as it likes, and even call multiple times per request.

@gatesn gatesn closed this Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants