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
2 answers

Atom linter-flake8 failed to spawn (not in PATH)

i installed linter-flake8 package in Atom . I got this error : [Linter] Error running Flake8 Error: Failed to spawn command flake8. Make sure flake8 is installed and on your PATH i'm sure flake8 is in the PATH . Have a look at the image i attach.…
andio
  • 1,574
  • 9
  • 26
  • 45
2
votes
0 answers

Enforce space between functions with Haskell linter

I want to enforce a space of exactly two lines between my top-level function declarations in Haskell. Is there any linter for Atom (or any other editor) that allows that?
Marcelo Lazaroni
  • 9,819
  • 3
  • 35
  • 41
2
votes
1 answer

Display Flycheck buffer (with errors) when saving

In Emacs, what would be the way to display the Flycheck buffer automatically when saving, only if there are errors? A bit like https://github.com/steelbrain/linter. I've searched on…
user3341592
  • 1,419
  • 1
  • 17
  • 36
2
votes
2 answers

Is there a way to get rid of the tab row in atom editor?

There was a change in base code of Atom.io, so there is a tab row in all panel. It is still bearable in my file tree view, but I do think it is really annoying to have the tab in linter warning panel too. Is there a way to get rid of it?
cytsunny
  • 4,838
  • 15
  • 62
  • 129
2
votes
2 answers

Splat (*) operator offense with constant and attr_reader with rubocop

Am getting an ambiguous splat operator error while trying to assign attribute reader using a class constant. Class X1 CONST = [:a, :b, :c] attr_reader *CONST end However, I have tried a few work arounds which still lead to an rubocop…
vachan D A
  • 49
  • 1
2
votes
1 answer

How to lint LESS or CSS in PhpStorm?

I was searching for linters in PhpStorm's plugin directory, but there are no results, which seems strange to me. Are people not using linters for their stylesheets in PhpStorm? Is there any other way to lint LESS files in a PhpStorm project? For…
pwagner
  • 1,224
  • 1
  • 13
  • 31
2
votes
0 answers

How to use standard linting for Jasmine files that reference functions?

I am using https://github.com/feross/standard When I run it against a Jasmine spec it complains about functions that are called not being defined. This seems to be because they are defined in other files. All the files are all included in the actual…
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
2
votes
0 answers

Angular2 Linters Extension for VScode

I recently came across new term called Linters extensions. During study, I understood that, linter is a small program that checks code for stylistic or programming errors. I have already used couple of code snippets - Angular 2 snippets from Dan…
Sanket
  • 19,295
  • 10
  • 71
  • 82
1
vote
0 answers

c/c++ vscode formatter closing braces on same indentation level as statements

General C/C++ code looks like this { statement; } I want to format it in a slightly unorthodox way as follows, { statement; } ^^ --> Closing braces on same indentation level as statements How do I achieve this automatically in…
1
vote
1 answer

Configure Pyright to use Ruff as a linter

I use Zed editor with Pyright and it works like a charm. However I want to use Ruff linter with Pyright but I don't find any documentation about how to achieve this for Zed editor. Do I have to specify linter directly in pyrightconfig.json and if so…
1
vote
0 answers

golangci-lint run times out

We have a pre-commit git hook locally set up that runs and for some reason I cannot get it to complete properly. This is the…
trever
  • 961
  • 2
  • 9
  • 28
1
vote
1 answer

How to fix dylint warning "return a type that includes relevant context"?

I have a function that looks as follows: pub fn hello() -> ResultGeneric<(), ProgramError> { // function body... some_byte_array.serialize(&mut &mut some_binary_data.borrow_mut()[start..end])?; } I enabled a linter (Dylint) and now it complains…
Sasha Shpota
  • 9,436
  • 14
  • 75
  • 148
1
vote
0 answers

Getting error while running goanalysis_metalinter

I am getting the following error when commitlint is enabled for go project, specifically for goanalysis_metalinter package bodyclose: failed prerequisites: analysis skipped: errors in package:…
HexaCrop
  • 3,863
  • 2
  • 23
  • 50
1
vote
2 answers

How to handle wide markdown tables and line-length checks in pre-commit?

Context After applying a line length limit of 80 characters on the pre-commit check of markdown-lint, I was experiencing some difficulties in including a markdown table that I create with more width than 80 characters. Note I see value in applying…
a.t.
  • 2,002
  • 3
  • 26
  • 66
1
vote
1 answer

lint specific folder using MegaLinter when there is a new push to the specific folder in github actions

I am pretty new for github actions workflow. I have the following question. What I have: Have a repo with subfolders folder1/dotnet and folder2/dotnet What I want to Achieve: I want to crate github workflow which will lint only folder1 and folder…