Skip to content

Use Pylint read from stdin feature #796

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
twmr opened this issue May 1, 2020 · 2 comments · Fixed by #831
Closed

Use Pylint read from stdin feature #796

twmr opened this issue May 1, 2020 · 2 comments · Fixed by #831
Milestone

Comments

@twmr
Copy link

twmr commented May 1, 2020

Since version 2.4 pylint has support for reading files from memory (stdin) by using the --from-stdin cmd line option

    --from-stdin        Interpret the stdin as a python script, whose filename
                        needs to be passed as the module_or_package argument.

# Pylint can only be run on files that have been saved to disk.

@goanpeca
Copy link
Contributor

goanpeca commented May 5, 2020

Hi @Thisch, what are you suggesting :-) ?

@twmr
Copy link
Author

twmr commented May 5, 2020

pylint can now read the source code from stdin in contrast to reading it from a normal file. Reading from stdin is already supported by many linters, but pylint got support for it last year.

To read the file from stdin you would have to call it like

cat  source.py  | pylint --from-stdin  source.py

IMO this new feature should be used in pyls, because then pyls could report issues of unsaved changes in files. See line 50 of pylint_lint.py

@ccordoba12 ccordoba12 added this to the 0.35.0 milestone Sep 10, 2020
@ccordoba12 ccordoba12 changed the title pylint has read-from-stdin support since v2.4 Use Pylint read from stdin feature Sep 10, 2020
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 a pull request may close this issue.

3 participants