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

What's the difference between tsserver and eslint as a linter?

I'm currently setting up my Neovim's Native LSP working environment, and I have a question about JS/TS linter. What is the difference between tsserver and eslint as a linter? I know that tsserver is a language-server that comprehensively supports…
1
vote
1 answer

mypy: Missing positional argument

I am using mypy as linter and a bit confused how default arguments are treated. I use following type annotation: def func(dict_1: Dict[str, Any], dict_2: Optional[Dict[str, str]]) and real function is signature is: def func(dict_1,…
Beliaev Maksim
  • 968
  • 12
  • 21
1
vote
1 answer

How to prohibit bang operator in Dart Linter / Pull request

Is it possible to fail a pull request pipeline if the developer has used the "Bang Operator" ? We are using dart linter already in our PR pipeline, is there such a rule to enforce the prohibition of the Bang Operator ? For example, this should not…
TSR
  • 17,242
  • 27
  • 93
  • 197
1
vote
3 answers

Do I need to import Numpy to use Pandas?

I'm using pandas to manage some data frames. In every tutorial I've seen so far, they import both numpy and pandas when working with pandas so I imported both. I also recently installed flake8 linter, and its giving me the following message: numpy…
Portfedh
  • 178
  • 1
  • 13
1
vote
2 answers

Python linter in VS-Code: raising error when method has a type annotation but no return statement

I am trying to enable in my linter the style-error (if this is the most suitable name) that should arise when a function has a type hint but no return statement. For instance: def do_stuff() -> int: a = 2 # this function expect at the very…
E. Faslo
  • 325
  • 5
  • 19
1
vote
1 answer

How to work if Linter throws error at every line?

Trying to work on a project, but I cannot commit because some Linter is under use. It throws errors like: Expected linebreaks to be 'LF' but found 'CRLF' I tried to follow the instructions at How do I force git to use LF instead of CR+LF under…
Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175
1
vote
1 answer

ALE Fixer Configuration in Neovim

I want to configure my Ruby fixer to perform the following sequence: Turn syntax off Run the rubocop fixer Turn syntax on According to :help ale-fix-configuration: Synchronous functions and asynchronous jobs will be run in a sequence for fixing…
clockworkpc
  • 628
  • 1
  • 6
  • 16
1
vote
1 answer

Inheriting 'NamedTuple', which is not a class.pylint(inherit-non-class)

I am trying to declare tokens with unique value in python: from enum import ( auto, Enum, unique ) from typing import NamedTuple @unique class TokenType(Enum): ASSIGN = auto() COMMA = auto() EOF = auto() FUNCTION = auto() IDENT =…
Diesan Romero
  • 1,292
  • 4
  • 20
  • 45
1
vote
0 answers

Exclude generated structs from golang linter

I have several protobuf structs that were generated to golang code. Inside structs I have imported generated fields: type GeneratedStruct struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields…
RedCollarPanda
  • 1,389
  • 1
  • 20
  • 40
1
vote
0 answers

Pass callback Function as Parameter to Widget while keeping Lint Rules "argument_type_not_assignable"

In my widget I pass a function callback as a parameter to the widget: onTap: onTapRestaurantItemCallback Out in the screen widget, which contains the widget above, I then execute the function callback: onTapRestaurantItemCallback: () { // Handling…
Rune Hansen
  • 954
  • 3
  • 16
  • 36
1
vote
2 answers

VS code, julia linter doesn't work (on mac)

having assured myself that julia is enabled and that the linter is too (in vs code settings: Julia › Lint: Run), i get syntax highlighting on my xxx.jl script but no linting at all. im on the latest vs code + latest julia 1.07 extension + latest…
mrchance
  • 1,133
  • 8
  • 24
1
vote
1 answer

How do you handle git merge conflicts in case developers are using different code beautifier?

The situation now, I’m getting git conflicts even though the codes are similar but each developer is formatting the code differently.
1
vote
2 answers

Python 3: Accessing Parent Attributes, Linter Error

I have some trouble accessing parent attributes appropriately in Python 3.8 with VS Code and PyLint. PyLint gives me an Error in the second file in the pseudo code listed below. file 1: class Parent: def __init__(self, parentAttr): …
puzzled
  • 69
  • 1
  • 8
1
vote
1 answer

Structured Data Linter ruby installation problem

I have a relatively big corpus of structured data, which I need to validate. I am planning to use Ruby Structured Data Linter from this repo https://github.com/structured-data/linter to automate the validation. After cloning the repo and…
gnomus042
  • 85
  • 5
1
vote
3 answers

Pylint: Linter pylint is not installed. after installing as extension - VScode

I just installed python 3.8.3 and created a file. a message shows up; Linter pylint is not installed. Source: Python (Extension) I clicked the install button and I have this error message now... $ C:/Python38/python.exe…
jefFoo
  • 109
  • 1
  • 11