Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@youben11
Copy link
Contributor

As per the discussion here #190 a way of supporting flake8 linting is by implementing an additional plugin that will use the flake8 config directly instead of passing it to other linting tools like pycodestyle and pyflakes (even if flake8 is a wrapper around those tools by itself).

Flake8 lacks (for now) of a stable public python API which should be implemented in the future, so I figured out a dirty way from the source code to access the report results and get the information we need to report back to the IDE, however, this should be updated whenever a python API is made available.

@youben11
Copy link
Contributor Author

@gatesn

pyls/plugins/flake8_lint.py Outdated Show resolved Hide resolved
pyls/plugins/flake8_lint.py Show resolved Hide resolved
pyls/plugins/flake8_lint.py Outdated Show resolved Hide resolved
pyls/plugins/flake8_lint.py Show resolved Hide resolved
setup.py Show resolved Hide resolved
pyls/plugins/flake8_lint.py Show resolved Hide resolved
pyls/plugins/flake8_lint.py Show resolved Hide resolved
The version is specified due to the hard way the code uses flake8
that might not work if a code change was introduced in flake8 codebase
@youben11
Copy link
Contributor Author

Test is failing because of the latest release of pylint #661

@youben11 youben11 changed the title [Draft] Flake8 plugin for linting Flake8 plugin for linting Sep 28, 2019
@uschi2000
Copy link

Looks good to me!

@youben11
Copy link
Contributor Author

youben11 commented Oct 2, 2019

@gatesn As flake8_config is now aggregating flake8 config for both pycodestyle and mccabe, we should update it to load the config under plugins.falke8, right? Users will no longer be able to use flake8 config files with pycodestyle and mccabe that way, the flake8 plugin will be the only one to use flake8 config files.

pyls/plugins/flake8_lint.py Show resolved Hide resolved
setup.py Outdated
extras_require={
'all': [
'autopep8',
'flake8==3.7.8',
Copy link
Contributor

Choose a reason for hiding this comment

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

Even though we use internal APIs, let’s not pin this. Otherwise we’ll end up conflicting with people’s own Flake8 versions.

We should just track latest the best we can I reckon

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done



@hookimpl
def pyls_lint(config, document):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we default this plugin to disabled, and when it is enabled disable pep8 and pyflakes? I think at the moment we’d end up with duplicate diagnostics which could be annoying

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, they shouldn't be running at the same time, and disabling flake8 by default is a good idea so current users don't feel the change but can enable linting directly via flake8 if they want to. But flake8_config have to be made loading config into flake8 plugin as well from now on.

@gatesn gatesn merged commit fecffb2 into palantir:develop Oct 12, 2019
lgeiger added a commit to atom-community/ide-python that referenced this pull request Oct 13, 2019
lgeiger added a commit to atom-community/ide-python that referenced this pull request Oct 13, 2019
@ccordoba12 ccordoba12 added this to the 0.29.0 milestone Oct 14, 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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.