-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add linters layer. #50
Comments
I think linter could / should go into core |
Agreed. I have the start of rust and go layers and they would both rely on linter. It seems odd to include the linter package in those layers as well as its own dedicated layer. |
On second thought, maybe including linting should be part of each lang layer. Core could implement a linter framework (if one exists) and the layers just plug into that. I think spacemacs is doing that with flycheck |
I'm pretty sure the linter package is the framework and then linters for specific languages hook into it. See the readme: https://atom.io/packages/linter |
If that is the case then we should definitely put that into core and have linter support be part of the layers. I think that makes the most sense |
Great, it should require zero config, just a matter of adding |
Agree, linter package is required for atom. I notice about separate layer because we can setup separate Readme, configurations and other stuff. For each :lang layer we can put required linter package and related configuration, and enable linter if user selected this layer in .proton. For example https://atom.io/packages/linter-clojure can be included in packages for In spacemacs there is separate layer called syntax-checking which based on flycheck. For each lang layer they just adds hook to flycheck-mode with appropriate language using function |
Here how it works in Spacemacs (I'm interested in knowing the differences with the Atom ecosystem) : The layer A language layer then declares a function
In these For completeness, the ownership of flycheck can be stolen by a layer redefining the There are also hooks available for So linters can be toggled on and off globally by just adding the |
Oh hi @syl20bnr! Great to see you here! 😄 Thanks for the insights. The way I understand it is that I guess a linter layer by itself that makes sure that Is post-init-{{something}} that we want / need as well? It would give layers more control but I think we don't have a usecase for that yet. |
In Spacemacs those linter addons are guarded with a
You'll surely need it at one point, One important detail: spacemacs only installs packages with a owner which means it installs only packages with a defined |
I thought a little bit more about this. So the current problem is:
Here are some ideas: 1. 2. 3. Any other thoughts? |
Attempt to lazy load linters after the :tools/linter layer has been enabled. Very hacky. Refs #50
Attempt to lazy load linters after the :tools/linter layer has been enabled. Very hacky. Refs #50
I like the first idea. For now not sure how we can use For testing purpose i've added |
Wow I didn't know you were already this far. I will cherry-pick some of the changes into the branch I'm currently working on and see if I can get this merged today 👍 |
Just to repeat what I already wrote in #56 (so we have it in 1 place): The problem with this approach is that clojure will just assign the multimethod to the latest defined one so we can't go with that. I introduced a new function called
It's a little bit more of state management but it basically collects all layers and builds a small dependency map. On package retrieval, it checks which layers/packages are enabled and fetches all sub-dependencies as well. |
Attempt to lazy load linters after the :tools/linter layer has been enabled. Very hacky. Refs #50
Not sure it will help but here is in more details how Spacemacs loads:
Important remarks:
|
Attempt to lazy load linters after the :tools/linter layer has been enabled. Very hacky. Refs #50
Attempt to lazy load linters after the :tools/linter layer has been enabled. Very hacky. Refs #50
Propose to add linters support within
:tools/linters
or:tools/error-check
.The text was updated successfully, but these errors were encountered: