get-alex / alex

Catch insensitive, inconsiderate writing
https://alexjs.com
MIT License
4.82k stars 207 forks source link

Is it possible to lint code comments and/or docblocks? #322

Open jgornick opened 3 years ago

jgornick commented 3 years ago

As the title says :)

I suppose one workaround for linting docblocks is linting any generated documentation from the docblocks.

Thank you!

wooorm commented 3 years ago

nope, there’s not really support for that. Although, you can pass --text on the CLI to see the files you give it as plain text. Alternatively, you could do the inverse based on what linter exists for your code, and integrate that to look for code comments, and run the alex API on those comments!

boomshadow commented 1 year ago

I use a combination of fd (a find replacement) and what @wooorm suggested above to get Alex as a linter in my projects' CI/CD pipeline. I find all ruby files, then pass to Alex to be linted as text. Then I do another search for markdown files and lint them like normal:

fd -e rb -x alex --text {}
fd -e md -x alex {}