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

Auto format flake8 linting errors in VSCode

I'm using the flake8 linter for Python and I have many code formats issues like blank line contains whitespace flake8(W293) I'm trying to auto fix these linting issues. I have these settings: "python.linting.enabled": true, …
nrofis
  • 8,975
  • 14
  • 58
  • 113
8
votes
1 answer

Why should I use let instead of const inside functions?

I add linters for js (es6) in my project, and for new configurations I found that they prevent using const inside functions - only for module-level constants. And inside functions I should use let. But I can't find any ground for such rule. Why? For…
Vasiliy vvscode Vanchuk
  • 7,007
  • 2
  • 21
  • 44
7
votes
0 answers

How to implement accessibility linting in GitHub actions?

I want to upgrade our GitHub workflows with accessibility linting based on WCAG 2.1. If it's possible I want to define the level too like AA. I don't want to run a full test on a website, only make a quick linting on the pull requests. The whole…
netdjw
  • 5,419
  • 21
  • 88
  • 162
7
votes
2 answers

Atom-Editor: Rubocop doesn't work with atom

I was trying to connect rubocop to atom, but received the error: linter-registry.js [sm]:144 [Linter] Error running RuboCop Error: /usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'rubocop' (>= 0.a) among 16 total gem(s)…
7
votes
2 answers

What's the difference between linting and compiling?

I know that in Java there is a compiler that tells you when you're writing some wrong code. But Javascript doesn't work that ways, cause it doesn't have a compiler. However, is "linting" javascripts way to compile code?
R. Andriana
  • 81
  • 1
  • 5
6
votes
1 answer

How to disable the warning "Omit type annotations for local variables"? in Dart (with Pedantic Package)

I use the pedantic package in Flutter and I have the following anaylsis_options.yaml file: include: package:pedantic/analysis_options.yaml # advanced linter analyzer: enable-experiment: - extension-methods linter: rules: …
DarkMath
  • 1,089
  • 2
  • 15
  • 29
6
votes
5 answers

why are pylint's error squiggle lines not showing in python visual studio code?

i'm using vscode for python3 in Ubuntu. Error-squiggle-lines have stopped working for Python(it works for other languages). And I am using Microsoft's Python extension. vscode v1.41.1 Ubuntu v18.04 this is what i have tried: I thought maybe it's…
Manik
  • 573
  • 1
  • 9
  • 28
6
votes
1 answer

Github Actions Error; cannot see git diff to Master

I am trying to find a way to lint only markdown files that have changed on the current branch. I wrote a bash script that runs fine locally, but breaks in Github Actions. Expected Outcome: lint only markdown files that have been changed on the…
C-Dev
  • 425
  • 1
  • 6
  • 15
6
votes
4 answers

How can I create a unit test for SQL statements?

I have a couple of SQL statements stored as files which get executed by a Python script. The database is hosted in Snowflake and I use Snowflake SQLAlchemy to connect to it. How can I test those statements? I don't want to execute them, I just want…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
6
votes
2 answers

Is there anyway to install credo globally?

I'm a newbie with elixir, and I'm trying to configure my text editor (vim + ale as lint engine) with the credo linter for elixir, but seems like there is no way to have it installed on the system. Its documentation just say how to install it on your…
gabrielperales
  • 6,935
  • 1
  • 20
  • 19
5
votes
2 answers

clang-tidy: Exclude specific dir from analysis

I'm using clang-tidy in a medium-size project with the following three folders: srcA srcB external I'm trying to exclude external folder from the analysis, but with no luck. The command I'm using is: clang-tidy $SRC -p build/…
tsarquis88
  • 453
  • 1
  • 6
  • 14
5
votes
1 answer

rlanguageserver: Disable specific linter and avoid line-breaking

I am using emacs and lsp-mode. To edit .R files, I use rlanguageserver. This works fine. However, I would like to disable some rules. For example, I do want to decide on my variable name format, i.e. disable the "variable name should be snake_case"…
user52366
  • 1,035
  • 1
  • 10
  • 21
5
votes
4 answers

How to replace this.$parent.$emit in Vue 3?

I have migrated my application to Vue 3. Now my linter shows a deprecation error, documented here: https://eslint.vuejs.org/rules/no-deprecated-events-api.html. The documentation shows how to replace this.$emit with the mitt library, but it doesn't…
mdziedzinski
  • 55
  • 1
  • 1
  • 7
5
votes
2 answers

Leading spaces inside Dockerfile for readability

Am I able to use indentation in a Dockerfile? Is there anything wrong with using spaces for indenting like this? FROM python:3.8-buster RUN pip --no-cache-dir install poetry gunicorn WORKDIR /app COPY poetry.toml pyproject.toml poetry.lock…
Paweł Smolak
  • 593
  • 6
  • 12
5
votes
0 answers

Flake8 linter not highlighting errors in Sublime Text

I have Sublime Text3 v3.2.1 Build 3207 installed on my Windows 10 PC. I have flake8 installed via pip command within conda environment. I have also installed the sublime flake8 linter and the python flake8 packages on sublime text. The problem is, I…
Krithi07
  • 481
  • 2
  • 7
  • 18
1
2
3
21 22