Comments (1)
There are several problems I have with this, one technical and one conceptually:
Technically, comments are only stored with a position. To figure out whether a comment "belongs to" an if statement, I'd have to look through all the comments and check whether the position is between the if
and end
of the if-statement I'm about to give a warning about for being empty.
Secondly, empty if-statements are dead code containing a potentially expensive condition expression. Regardless of whether they contain a comment or not, they are redundant. If you never fill in the -- TODO
, you keep the empty if-statement, which is well worth a warning. It would be better to comment out the entire if-statement.
Because of that I don't think any time should be spent on implementing this. An if statement is empty too when contains only comments.
from gluafixer.
Related Issues (20)
- Create a max line length config HOT 6
- Having issues with "Failed to find "glualint" HOT 1
- Glualint pretty print breaking on certain code HOT 5
- Failed to pretty print code with Chinese chars comments. HOT 6
- Error when using `\z` while the code runs fine HOT 5
- [Request] Pretty-Print: Nest table elements/function parameters HOT 3
- Hackage release HOT 3
- Directory args no longer parsed HOT 4
- `.glualint.json: withFile: does not exist (No such file or directory)` HOT 2
- --pretty-print no longer defaults to stdin since 1.24.4 HOT 1
- Failure to parse number HOT 5
- Pretty print issues HOT 8
- Beautifying makes function fail syntax HOT 2
- Syntax Failure HOT 7
- Comment after last element in table causes pretty print to add trailing whitespace HOT 1
- `lint_redundantParentheses` doesn't seem to catch all redundant parentheses HOT 1
- Add `prettyprint_spacebetweenconcats` config HOT 1
- The version 1.25.0 is ignoring the lint_ignoreFiles setting for some reason. HOT 9
- Ability to skip formatting specific lines, or condensed/minified formatting HOT 2
- Pretty Print Expanding Function Definitions Inside Calls HOT 24
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 gluafixer.