-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
[beta] How to publish SL4 with breaking changes (PythonLinter) #728
Comments
The changes I did are meant to be forwards compatible. 😒 - 🐛 s Following status: note: overrides internal note: remove cruft after SL4 note: remove cruft after SL4 note: remove cruft after SL4 note: ❓ uses note: remove cruft after SL4 |
https://github.com/SublimeLinter/SublimeLinter-json and https://github.com/SublimeLinter/SublimeLinter-annotations were broken, now fixed. |
Well that's even better then. Awesome. So, we have to go and find all python-based linters and prepare them, als you already did elsewhere? I hit a few that aren't in the org, so I want to set up some analytics on the linters that are out there so we can get a good look at what we're touching. May be useful for other refactors as well.
There are alternatives like SublimeLinter-contrib-yamllint, which sounds like a better and more useful approach to linting yaml. We could consider deprecating -pyyaml in favour of something else if it doesn't look upgradable. |
@braver Can you write a script that checks out plugins and collects information about what methods they override. If possible also what API calls on |
Good idea, sounds like a fun project. I'll have to see what's within my abilities here though. |
For JSON: using For YAML: https://github.com/rasshofer/yaml-lint is probably the better choice. Or: https://github.com/adrienverge/yamllint Use https://github.com/twolfson/restructuredtext-lint instead note: Should not override |
https://github.com/thomasmeeus/SublimeLinter-contrib-yamllint is python based and should work. 👍 npm's |
Excellent, sounds like a plan. |
FWIW @braver all linters can be found https://github.com/SublimeLinter/package_control_channel/blob/master/contrib.json and https://github.com/SublimeLinter/package_control_channel/blob/master/org.json From there you get a git link, try to fetch the |
Thanks, I'll try something like that. Am already running into repos that don't exist anymore, so this is already useful :) |
Note that #653, which concerns all linters and not just Python, could potentially introduce even more breaking changes, depending on how it is tackled. However, replacing the Python linter is the biggest and most significant change. Once inline loading is gone, we can look into streamlining the process for different virtualenv types and potentially adjusting the API for this. Maybe a task for SL5 though. |
Oh, I almost forgot: SublimeLinter is not a candidate for being deployed as a dependency because it rightfully provides user-facing commands and interfaces with ST (event listeners, commands, keybindings, etc). Dependencies are only for Python stuff. |
Oh, you're right. Good, that's off the table then. #653 Runs through a lot of annoyances, not all of which related to the way linter executables are found, and several which are already resolved. E.g. we stop advocating the use of sublimelinterrc and inline settings at all and especially for linters that don't need them, and all python linters plugins now respect tox.ini and similar config files. I like the rigidity of the proposal, but I'm not 100% sold on it. I think explicitly setting an executable should be what you use if the automagic doesn't work. I believe for the vast majority of users the current overall approach does actually work. So, I really feel like the work of @kaste is on the right track and don't necessarily see the need for similar big changes for non-python-based linters. The eslint linter is the only one I know that seems to have a bunch of weird setup issues, but the linter itself doesn't always work the way you expect and it attracts a lot of inexperienced web developers... eh, by which I mean, there are a lot of those (I used to be one), not necessarily that they ask dumb questions (there are no dumb questions etc) 😉 |
I don't understand #653, it is basically a rant bc flake8 didn't work for a week or two. SublimeLinter is already about finding executables. It uses package.json, pipenv, PATH The riskiest things we can do or have to do, is decoupling the different systems. We can and should move I'm also would like to see that the actual linter only calls the linter and parses its output. It shouldn't be concerned with drawing. |
What's a good filename for all the static functions like |
Luckily abuse of that surface area is pretty limited. It's not really possible to reduce it, linters can import anything they and we can't do much about it, but I'm not against improving the organisation of the codebase as long as we put in some effort to fix what we break. I'd like to see that as a separate phase after we merge #723 though, which I hope to be able to do some time next week. |
I think #653 ist just a bit too loaded and covers too many areas, some if which I agree with and some I don't necessarily. I guess I should sum this up with "we should try to find a linter executable in common virtual environment paths but allow an explicit override in case that fails or doesn't procude the desired result", which is what the new PythonLinter accomplishes, as far as I understand. The rest is details, that I'm not involved enough with to make a call, or similar. This probably wouldn't break compatibility as much as the new PythonLinter though, so we can probably put that off until the next minor release or something. (Oh, I think I also mostly wanted to refer to my comment there since this is pretty much the only thing I remember from that issue. 😅 ) |
Linter plugins using PythonLinter (check means @kaste reports it working):
|
flake8 should just work bc it has its own implementation. I have a clean version on my computer running. Didn't I PR already? |
Thanks for the list. They try to fix SL3 behavior:
I fixed this too, so the correct API now is to not set The user story: A user wants to lazy evaluate and find/locate which executable to run. The 'correct' way for SL3 was, to override the crazy Honestly, you'd had to copy-paste this to get it right. Our base linters all copy pasted here. For SL4, I wanted a simpler solution. If you want a dynamic executable, you don't set |
Is there a change we can propose in contrib-gcc to prepare it? |
An ugly one. You basically would use what the original SublimeLinter author wanted you to use. You implement
I think that's the intended API usage. Originally SublimeLinter was designed to have static executables. They were resolved in |
Ok, we can at least open an issue there so they can anticipate the upcoming changes. Edit: posted SublimeLinter/SublimeLinter-gcc#5 Too bad there isn't a SL-based alternative for rst, but it's also unmaintained since 2014. I'll put something in the readme (edit: Done), perhaps someone turns up who wants to go out and fix things. |
Flake8 at master does result in breakage on my machine. I'll just publish a prerelease there too. |
Ok, I think we're good here. Thanks everyone! |
SublimeLinter-contrib-CFLint is broken |
cc @kaste, re #723
We're about to break compatibility with the python-based linters. I don't want to drag around legacy code and backwards compatibility in this repo if I can help it, so a decision needs to be made on how to go about this without simply breaking everything (which would be not good).
Two ideas I've come up with so far.
1. Publish SL4 not as a package itself but as a dependency
This is a pretty new possibility and it would be a good fit. SublimeLinter doesn't do anything by itself anyway.
Good:
Bad:
So, unless we're able to really push all 7 pages worth of linters forwards in a short period of time, or unless we build a time machine, this sounds really nice but impossible.
2. Version check in the linter
We could make the python-based linters forwards-compatible. We could edit their linter.py to check if they're running on SL3 and SL4 and have an implementation for both.
Good:
Bad:
I think this might work because we can do all of it behind the scenes, while the SL4 release still forces the move forwards. We really need to drop the old behaviour so let's use that momentum.
More ideas?
The text was updated successfully, but these errors were encountered: