NND
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2018
03:18 PM
New code linting tool for BrightScript
If you are interested in improving your coding style and consistency and maybe catching a bug or two check out BrsLint. BrsLint is a tool that parses brightscript and checks code against predefined rules. It also performs static analysts to identify situations that can cause runtime errors, like accessing undefined variable.
BrsLint is written in javascript and works on Windows, macOS and Linux. See it here: https://www.npmjs.com/package/brslint
BrsLint is written in javascript and works on Windows, macOS and Linux. See it here: https://www.npmjs.com/package/brslint
4 REPLIES 4
owen777
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2018
01:07 AM
Re: New code linting tool for BrightScript
Hey,
appreciate the job, but, let me be honest with you, it's just another not-so-useful brightscript linter. It misses a lot of very basic rules like indentations, trailing commas, multi spaces, empty lines and so on. Anyway, I really like the "function_too_big" rule which I'd call "fresh" in this hundreds-lines brightscript functions world. By the way, rules documentation would be nice to have.
Unfortunately, all available brightscript linting tools are quite limited and for our project we had to go the eslint + custom rules way - highly recommend.
appreciate the job, but, let me be honest with you, it's just another not-so-useful brightscript linter. It misses a lot of very basic rules like indentations, trailing commas, multi spaces, empty lines and so on. Anyway, I really like the "function_too_big" rule which I'd call "fresh" in this hundreds-lines brightscript functions world. By the way, rules documentation would be nice to have.
Unfortunately, all available brightscript linting tools are quite limited and for our project we had to go the eslint + custom rules way - highly recommend.
NND
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2018
12:56 AM
Re: New code linting tool for BrightScript
You can add some of the rules you've mentioned relatively easily. Unfortunately I don't have time to spend adding bunch of the new rules, but I would take a PR with new rules.
I am not sure how eslint supposed to help considering that JavaScript and BrightScript have different syntax?
I am not sure how eslint supposed to help considering that JavaScript and BrightScript have different syntax?
owen777
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2018
04:02 AM
Re: New code linting tool for BrightScript
I forgot to mention - using https://github.com/RokuRoad/bright as parser
NND
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2018
08:48 PM
Re: New code linting tool for BrightScript
It is nice to have choices for BrightScript parsing for sure. Three years ago my only option was to create my own tools.
I looked at RokuRoad's parser and while it is pretty solid it did fail on few of my samples. For example it fails on `foo()()`.
Also on code with conditional compilation like this:
I looked at RokuRoad's parser and while it is pretty solid it did fail on few of my samples. For example it fails on `foo()()`.
Also on code with conditional compilation like this:
#if false
My comments here
#endif