Questions tagged [linter]

NOTE: It is recommend to use the tag static-analysis instead. "Linter" is slang for static analyzer, a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs at compile-time. The slang "linter" originates from the specific product PC Lint.

"Linter" is slang for static analyzer, a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs at compile-time. Whereas a dynamic analyzer is a tool that performs similar analysis in run-time.

The slang "linter" originates from the specific product PC Lint, though there are many other such tools for various programming languages and coding standards.

The first linter was written by Stephen C. Johnson in 1978 while working in the Unix operating system at Bell Labs. After that, many other linters have appeared for different purposes and languages, not only C.


Tag usage

Since "linter is slang and not a formal term, it is recommend to use the tag instead. Always use that tag in combination with tags for the specific language, standard and tool used.

Tag usage example: .

Also include versions of the programming language, coding standard and tool where applicable.

326 questions
1
vote
1 answer

Give Warning for Certain Syntax

I had an experience with slow sqlalchemy subquery using syntax Query.select_from(). Based on this experience, I want to get warning everytime certain syntax is used in our codebase. For example, when programmers add this code bellow, I want to get…
pupil
  • 318
  • 2
  • 16
1
vote
1 answer

ESLint in React Native not linting in command line

I just installed ESLint to React Native (create-react-native-app) .eslintrc.json { "env": { "browser": true, "es6": true, "react-native/react-native": true }, "extends": [ "eslint:recommended", …
Istvan Orban
  • 1,607
  • 3
  • 18
  • 34
1
vote
1 answer

How to config Linter for React Native?

I made a React Native App (made by create-react-native-app). I installed the eslint linter, but I got no idea how can I config it? (https://www.npmjs.com/package/eslint-plugin-react-native) I don't have the slightest idea where to put the: { …
Istvan Orban
  • 1,607
  • 3
  • 18
  • 34
1
vote
2 answers

SublimeText and php-cs errors

I install SublimeLinter and PHP-cs with PHP-cs Fixer and I'm getting some warning and some errors, but I want to ignore them. 2:1 error phpcs: error Missing file doc comment 11:1 error phpcs: error Missing doc…
Carloscito
  • 373
  • 1
  • 2
  • 16
1
vote
0 answers

Atom linter-gcc doesn't work with multiple files

Hellow. I have test project with two .c and one .h files. And in this case linter-gcc doesn't see header file. /* main.c */ #include "module.h" int main() { f(5); return 0; } /* module.h */ #ifndef HELLOW #define HELLOW void f(int…
EveHo
  • 45
  • 1
  • 5
1
vote
0 answers

Can't get a linter to work in Atom editor

I recently decided to try out atom, but noticed that there was no linter built in (at least for js, which is what I am using it for). So I downloaded linter (2.2.0), and linter-eslint (8.4.1), restarted atom, saved my code, and still, nothing…
Adam.V
  • 779
  • 2
  • 9
  • 25
1
vote
0 answers

ATOM PHP linter without php installed

I'm looking for an alternative way to use PHP-Linter on ATOM. I have a computer with ATOM, and a Vagrant and inside a PHP Docker Container. of course I can map my Docker PHP to Vagrant then to my Host but im looking for an alternative. Thanks.
Ollie K.
  • 51
  • 6
1
vote
1 answer

Atom Python: Functions not recognised

I'm using Atom as my editor and I'm currently working with python. I have installed the packages: autocomplete-python and language-python For some reason, functions are not marked properly. Any idea how to turn that on?
J. Hesters
  • 13,117
  • 31
  • 133
  • 249
1
vote
1 answer

JavaScript Linked List: Methods removeHead() and contains() not working

Using ES6 style, the task is to build a linked list and pass it through an npm linter test. Here is the code I have written: class LinkedList { constructor() { this.head = null; this.tail = null; // Do not modify anything inside of the…
MadHatter
  • 366
  • 1
  • 7
  • 23
1
vote
1 answer

Atom linter / es-lint disable some warnings

I am writing some tests with wdio and mocha framework and my linter packages https://atom.io/packages/linter and https://atom.io/packages/linter-eslint display some problems (see comments): describe('[On Board]', () => { //describe is not defined …
Gobliins
  • 3,848
  • 16
  • 67
  • 122
1
vote
0 answers

Uniquely identifying function declarations in Go AST for Linter

I'm creating a custom linter for Go which validates certain parameters of the 'foo' function in the example below. Let's assume we have a sample.go, which looks something like this. // Package pkg does something. package pkg import ( …
Ramie
  • 1,171
  • 2
  • 16
  • 35
1
vote
1 answer

lintr no visible binding for global variable ‘.SD’

lintr throws error while using data.table functions like .SD, .SDcols, e.g: /path/readData.R:130:29: warning: no visible binding for global variable ‘.SD’, Did you mean 'SSD'? DT[, "row.sum" := rowSums(.SD), .SDcols = names(DT)] …
Taz
  • 5,755
  • 6
  • 26
  • 63
1
vote
0 answers

Library or API for performing checkstyle on source code

I'm experimenting on how I can run check style on a source code without saving it as a file and run check style through ANT. Are there any libraries or APIs available in check style to trigger checks from Java code? How any linting libraries(Java…
Buddha
  • 4,339
  • 2
  • 27
  • 51
1
vote
2 answers

TSLINT config : exclude external modules

I'm using angular2 webpack starter with tslint configured on it. I also use ngx-datables (directory @swimlane directly in node_modules). I have plenty of warnings like : @ ./~/@swimlane/ngx-datatable/src/utils/index.ts 14:0-32 @…
Callehabana
  • 95
  • 2
  • 14
1
vote
1 answer

`pylint`: how do you enable errors for tabs or spaces indentation?

I am trying to enforce some simple python formatting rules. I found pylint and I have been very happy. However one of the more simple formatting checks I need to enforce is: tabs-only or spaces-only indentation. In pylint, how do you enable errors…
Trevor Boyd Smith
  • 18,164
  • 32
  • 127
  • 177