Comments (6)
The -
indicates that flake8 should read from stdin.
The last line that throws shows flake8_mock.py
as the culprit. Probably remove that flake8 plugin. Which flake8 do you use here?
from sublimelinter-flake8.
@kaste There is A LOT of flake8 plugins involved. I've just installed all of the requirements from this project - https://github.com/tough-dev-school/education-backend/blob/master/dev-requirements.txt
I'll try to delete the flake8 mock. Not sure if this is a right decision in the long term. If this plugin is in project's requirements it probably should be used.
from sublimelinter-flake8.
With flake8 mock uninstalled the error is now in flake8 pytest
SublimeLinter: linter.py:1127 flake8: Checking lint mode 'background' vs lint reason 'on_modified'. Ok.
SublimeLinter: sublime_linter.py:345 Delay linting 'linter.py' for 0.0s
SublimeLinter: linter.py:1127 flake8: Checking lint mode 'background' vs lint reason 'on_save'. Ok.
SublimeLinter: #31 linter.py:1144 flake8: linting 'linter.py'
SublimeLinter: #31 linter.py:922 flake8: wanted executable is '/home/edvard_munch/programming/python/education-backend-master/venv/bin/flake8'
SublimeLinter: #31 linter.py:1704 Running ...
/home/edvard_munch/.config/sublime-text (working dir)
$ cat Packages/SublimeLinter-flake8/linter.py | /home/edvard_munch/programming/python/education-backend-master/venv/bin/flake8 --format default -
reloading python 3.3 plugin SublimeLinter-flake8.linter
SublimeLinter: sublime_linter.py:345 Delay linting 'linter.py' for 0.0s
SublimeLinter: sublime_linter.py:345 Delay linting 'linter.py' for 0.0s
SublimeLinter: sublime_linter.py:345 Delay linting 'db.py' for 0.0s
SublimeLinter: linter.py:648 flake8 linter reloaded
SublimeLinter: linter.py:1111 flake8: Unknown reason 'relint_views' is okay.
SublimeLinter: linter.py:1111 flake8: Unknown reason 'relint_views' is okay.
SublimeLinter: linter.py:1111 flake8: Unknown reason 'relint_views' is okay.
SublimeLinter: sublime_linter.py:396 Friendly terminate: <pid 19488>
SublimeLinter: sublime_linter.py:593 Linting 'linter.py' took 0.11s
SublimeLinter: #33 linter.py:1144 flake8: linting 'linter.py'
SublimeLinter: #32 linter.py:1144 flake8: linting 'linter.py'
SublimeLinter: #33 linter.py:922 flake8: wanted executable is '/home/edvard_munch/programming/python/education-backend-master/venv/bin/flake8'
SublimeLinter: #32 linter.py:922 flake8: wanted executable is '/home/edvard_munch/programming/python/education-backend-master/venv/bin/flake8'
SublimeLinter: #34 linter.py:1144 flake8: linting 'db.py'
SublimeLinter: #34 linter.py:922 flake8: wanted executable is '/home/edvard_munch/programming/python/education-backend-master/venv/bin/flake8'
SublimeLinter: #32 linter.py:1704 Running ...
/home/edvard_munch/.config/sublime-text (working dir)
$ cat Packages/SublimeLinter-flake8/linter.py | /home/edvard_munch/programming/python/education-backend-master/venv/bin/flake8 --format default -
SublimeLinter: #33 linter.py:1704 Running ...
/home/edvard_munch/.config/sublime-text (working dir)
$ cat Packages/SublimeLinter/lint/linter.py | /home/edvard_munch/programming/python/education-backend-master/venv/bin/flake8 --format default -
SublimeLinter: #34 linter.py:1704 Running ...
/home/edvard_munch/programming/python/education-backend-master (working dir)
$ cat src/app/conf/db.py | /home/edvard_munch/programming/python/education-backend-master/venv/bin/flake8 --format default -
SublimeLinter: #32 linter.py:62 ERROR: Traceback (most recent call last):
File "/home/edvard_munch/programming/python/education-backend-master/venv/bin/flake8", line 8, in <module>
sys.exit(main())
File "/home/edvard_munch/programming/python/education-backend-master/venv/lib/python3.10/site-packages/flake8/main/cli.py", line 22, in main
app.run(argv)
File "/home/edvard_munch/programming/python/education-backend-master/venv/lib/python3.10/site-packages/flake8/main/application.py", line 363, in run
self._run(argv)
File "/home/edvard_munch/programming/python/education-backend-master/venv/lib/python3.10/site-packages/flake8/main/application.py", line 351, in _run
self.run_checks()
File "/home/edvard_munch/programming/python/education-backend-master/venv/lib/python3.10/site-packages/flake8/main/application.py", line 264, in run_checks
self.file_checker_manager.run()
File "/home/edvard_munch/programming/python/education-backend-master/venv/lib/python3.10/site-packages/flake8/checker.py", line 323, in run
self.run_serial()
File "/home/edvard_munch/programming/python/education-backend-master/venv/lib/python3.10/site-packages/flake8/checker.py", line 307, in run_serial
checker.run_checks()
File "/home/edvard_munch/programming/python/education-backend-master/venv/lib/python3.10/site-packages/flake8/checker.py", line 589, in run_checks
self.run_ast_checks()
File "/home/edvard_munch/programming/python/education-backend-master/venv/lib/python3.10/site-packages/flake8/checker.py", line 494, in run_ast_checks
for (line_number, offset, text, _) in runner:
File "/home/edvard_munch/programming/python/education-backend-master/venv/lib/python3.10/site-packages/flake8_pytest.py", line 30, in run
noqa = _get_noqa_lines(self.filename)
File "/home/edvard_munch/programming/python/education-backend-master/venv/lib/python3.10/site-packages/flake8_pytest.py", line 51, in _get_noqa_lines
tokens = tokenize.generate_tokens(lambda L=iter(code): next(L))
ValueError: I/O operation on closed file.
SublimeLinter: #32 linter.py:1225 flake8: no output
SublimeLinter: sublime_linter.py:593 Linting 'linter.py' took 0.49s
from sublimelinter-flake8.
Very unfortunate. These plugins and dependencies are pretty outdated as it seems. They don't support stdin input which is a normal feature of flake8 we require here as otherwise we can't run while you're typing in the editor. Actually your teachers should update the educational project; they pin flake8 to 3.x although we're on 5.x already and imo all plugins to flake8 should be selected so they support all common core feature of flake8.
Unfortunately it is not pluggable here to run on stdin or only on save where we could use the normal file names as on the CLI. The safer, defensive approach from our side would be to support that and maybe automatically switch operation modes here. (Actually #106 would do this if you switch the lint_mode
to on_save
as well.)
Honestly, it is not clear why an educational, beginner project should need that many dependencies IMO. dependencies need to get managed which just adds more work to the teachers.
from sublimelinter-flake8.
TLDR; we require from flake8 more feature than we need as a bare minimum. they ("you" or your teachers) pin to flake8 plugins not fully supporting the flake8 standard feature set.
from sublimelinter-flake8.
@kaste oh, thanks. It's not really an educational project. Name is kinda misleading. It's a project for an educational web-site where you can buy courses etc.
It's started working perfectly, when I deleted flake8-pytest
from sublimelinter-flake8.
Related Issues (20)
- recent update triggers ImportError of configparser module HOT 4
- Does not work at all in Sublime 3.1.1 HOT 3
- F401 handling trips on star imports HOT 3
- No linting errors reported but there should be
- Can't find this package in Package control HOT 3
- .flake8 in a subdirectory HOT 4
- can get E,W type errors, but no F type errors HOT 7
- Error: 'selector' is mandatory in 'cls.defaults' HOT 3
- Is --per-file-ignores supported for flake8 >= 3.7.0? HOT 11
- Package not showing in packaging control anymore HOT 1
- Shows E251 for function definitions having type annotations HOT 2
- Args seem to be getting ignored HOT 1
- Extend "E501 line too long" match till end of line HOT 1
- AttributeError: 'int' object has no attribute 'rstrip' HOT 3
- W type errors not showing HOT 1
- SublimeText 4 Support HOT 2
- Using per-file-ignores argument in settings causes an error HOT 4
- plugin_host-3.3 has exited unexpectedly HOT 6
- List unpack operator in assignment triggers false positive HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sublimelinter-flake8.