-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
lint: cleanup unused code and redefined locals #2865
Conversation
I oppose to this change 🤔
Moreover even if you can clean up everything in this PR, as the project evolves with more contributors making new contributions, the codebase will become "dirty" again. So this is not too meaningful.
I don't know much about neovim, but maybe neovim should implement a better support for hint diagnostics? 😂 And if luals's author(s) agree on allowing |
This project currently has no automated lint checks. That doesn't mean problems can't be fixed.
Not all editors have the same UI. The only contract is LSP.
Neovim implements hint diagnostics exactly according to protocol.
Many of the changes here remove redundancy, and so makes the code easier to read and reason about. That is meaningful. Just because code gets dirty over time, doesn't mean it shouldn't ever be fixed.
Yes it seems some users of vscode think that every other editor should display diagnostics the same way as vscode does. It would be a shame if this project only accepts changes that make the experience in vscode better, but not other editors.
What would be better would be to run LuaLS's The point of unused |
Because? It helps to explain you reasoning so that people have a chance to understand and/or change their approach to their PR. Even without bringing any editor into the mix, removing unused code is standard practice to keep code clean. |
My whole comment #2865 (comment) is explaining my arguments, I don't know if you have read it @dundargoc |
You still have not explained why the changes are bad, just that vscode or neovim has some behavior, which I don't understand the relevance whatsoever. This PR is just a refactor to clean up code. Use whatever editor you want, literally no one cares. |
Your actions are very meaningful, but making such changes to the current version will only affect the progress of merging after the development of version 4.0 is completed. I think we should consider such matters after version 4.0. |
I don't see any real downsides from these changes. It appears to me to just clean up the code a bit. I like the addition of using As far as I am aware, v4 is a complete rewrite, so there wouldn't really be any merge conflicts, there would just be the sort of “new history”. Footnotes
|
edit: Here comes my further reply. I drafted this comment a couple hours ago, and before I posted it maintainers seems replied just now as well. 👀 If maintainers agree on this change, then I have no more reason to object it 🙂 .
😮 I just learn this today, so it seems that vscode is the one not following standard 🤦♂️
I agreed. But even then, the default severity check level is warning, that means under normal circumstances LuaLS recommends checking diagnostics with severity >= warning as problems to be fixed: https://luals.github.io/wiki/usage/#--checklevel
I go for remove redundancy (those unused You said
Every project may have a preferred setup. For example
I don't agree this is a shame if this project only make experience in vscode better but not other editors, as there is no way to make all editors happy. 🤔 Unless in the development guide of this project states that any editor is welcomed, then the codebase / settings in this project should be responsible for making every editors happy. In short, I go for fixing anything And sorry if I cannot express myself concisely, english is not my first language 🙈 |
I hope my recent reply above can explain myself more clearly @dundargoc 😃 |
Unrelated to lint, I believe that cleaning up unused variables and the code itself is an improvement. |
I admit that I didn't read the whole PR changes initially when I made my first comment 🙏 So my only concern left, is the introduction of |
All the unused code gets reported as diagnostics in Neovim which is a bit distracting. Attempted to clean most of it up here.