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
2
votes
1 answer

How to check whether Pylint setup is OK

How can I check if Pylint is successfully installed and configured in Visual Studio Code? I have already set "Python: enable linting", but it seems to not be working. I ran code in the below problem field. Can someone explain what's going on in the…
stephen xu
  • 21
  • 3
2
votes
2 answers

Define a linter rule for flutter and dart

As you know there are some pre-defined rules for linter, but I wonder how can I define a custom linter rule for flutter and dart?
Hamed
  • 5,867
  • 4
  • 32
  • 56
2
votes
2 answers

Why does prettier automatically insert empty interpolation code characters?

Why does prettier create automatically insert empty interpolation {' '} code characters? Here's my .prettierrc.json: { "trailingComma": "none", "tabWidth": 2, "semi": true, "singleQuote": true, "jsxSingleQuote": true }
2
votes
2 answers

error Command failed with exit code 1. with react-native and yarn eslint

When I run yarn run lint fileName, it returns error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. What I've tried are yarn install and yarn upgrade. npm install is also…
TIshow
  • 918
  • 4
  • 12
  • 27
2
votes
1 answer

How to get GCC/Clang to error on reserved identifiers

In large codebases, it might be impossible for the maintainer/project-owner to review and audit every line of code. In C++, some identifiers are reserved (according to the standard) and prohibiting the definition of reserved identifiers seems…
Bernardo Sulzbach
  • 1,293
  • 10
  • 26
2
votes
1 answer

How to stop python linter (VSCode) from switching importing order

I am currently using the default python linter in VSCode. However, the linter (Format Document) keeps changing the importing order of modules like below. Since the module (project_settings.py) is in the parent directory of the current…
Jiho Choi
  • 1,083
  • 1
  • 10
  • 26
2
votes
1 answer

Vim ALE processing an older version of the file I'm editing

I'm using VIM 8.1 with ALE, specifically the rust linter (basically just cargo). The problem is that the errors and warnings reported by ALE are from an older version of the current file. Editing and saving the file has no effect, nor does…
YourGamerMom
  • 377
  • 3
  • 13
2
votes
4 answers

Rubocop: Is it possible to add exclusions to Metrics/AbcSize cop?

Let's consider the following class: class App def call # ... end private def foo # ... end def bar # ... end end Is it possible to configure rubocop to 'complain' about Metrics/AbcSize for all methods when Assignment…
Marian13
  • 7,740
  • 2
  • 47
  • 51
2
votes
1 answer

Dart linter: enforce type annotation everywhere except lambdas

I want my linter to complain about missing type annotations everywhere except for lambdas, because in my opinion it worsens the code readability with little advantages. For example those statements should raise a warning/hint: const s = 'my string';…
Pado
  • 1,497
  • 16
  • 28
2
votes
2 answers

How to make sure doxygen-style documentation comments aren't missing from C/C++ code?

I want to run some kind of linter or static code analysis on C/C++ code which gives a warning if there is code with missing documentation, for example a function without its doxygen-style documentation coment. In other words, I want to enforce…
finefoot
  • 9,914
  • 7
  • 59
  • 102
2
votes
0 answers

Unable to run linter-flake8 with atom editor

I have the following error whenever I open a python file in Atom /home/shihab/.atom/packages/linter/lib/linter-registry.js:154 [Linter] Error running Flake8 Error: Traceback (most recent call last): File…
Shihab Khan
  • 213
  • 1
  • 13
2
votes
0 answers

Parsing error: Unexpected token => with Linter(Travis CI)

I have this code, but Travis CI keeps denying it when I push up to GitHub because of the =>, but I am not sure how to rewrite it so it will pass. Also, I do have es6 listed as true in my linter file bcrypt.compare(password, hash, err, pwMatches) =>…
2
votes
0 answers

Problem using `flake8` for linting on Sublime Text 3

I've been unsuccessfully trying to use the SublimeLinter-flake8 on my Xubuntu laptop. I have Python 3.7.7 installed through the Anaconda distribution, as well as the flake8 package. I'm also using the Anaconda IDE plugin for Sublime Text 3, with…
neuron
  • 551
  • 3
  • 9
  • 16
2
votes
1 answer

Exclude entire directory with whitespace in name

I have a directory called "Old stuff" that I want flake8 to not lint code in this directory. What is the correct syntax to exclude it? I looked at the documentation for configuring flake8 but did not find what I wanted. I tried in my .flake8…
Julien Rousé
  • 1,115
  • 1
  • 15
  • 30
2
votes
0 answers

Rubocop atom linter does not work

I already installed rubocop globally and checked the version, and also the linter-rubocop, but when I open a ruby file in the editor this error appears in the console: Error running RuboCop Error: -s/--stdin requires exactly one path. I've tried…
Mateus Luiz
  • 756
  • 7
  • 20