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

SCSS linter for Codemirror

How can I make linter work in Codemirror for SCSS mode? If I use css-lint.js then I receive errors such as, Unknown @ rule: &mixin.
Dan Bray
  • 7,242
  • 3
  • 52
  • 70
1
vote
1 answer

Android Studio: lint to enforce '&&' instead of '&'?

Is there an option in Android Studio linter settings to make sure any occurrence of the boolean '&' operator causes an error and only allowing the '&&' operator (while still allowing the & operator for bit-wise operations on numbers)? TL;DR: As you…
digory doo
  • 1,978
  • 2
  • 23
  • 37
1
vote
0 answers

OSX - ignore_match - SublimeLinter - HTML-tidy

I'm trying to get SublimeLinter and HTML-tidy ignore specific errors on my html file. I never used SublimeLinter before so I'm kinda confused. Is there any way I can ignore unnecessary errors? because it's kinda annoying to see a lot of orange mark…
1
vote
1 answer

Flake 8's equivalence to ESLint max-statements

max-statements in Javascript ESLint offers a really good enforcement for small, modualized and readable functions. I was hoping to find something similar in Python Flake8 lint but so far I've had no luck. Is there a way of configuring Flake8 to…
TheInvisibleFist
  • 445
  • 1
  • 6
  • 12
1
vote
2 answers

How to get list of added and updated line numbers from a range of git commits?

Intention: Due to a heap of legacy code, I'd like to lint only lines added or changed in my Pull Requests to make the environment gradually better. Input: Name of the base branch (master), name of my PR branch (e.g. honzajavorek/my-cool-feature),…
Honza Javorek
  • 8,566
  • 8
  • 47
  • 66
1
vote
1 answer

Php executable for php-linter when using xampp (ubuntu) not working

As the topic sentence says. I'm using atom with linter-php in ubuntu with an xampp setup. PHP is located in the opt/lampp/bin folder when you've installed xampp in ubuntu 16 but atom isn't accepting it. "unable to get version" and "spawn php…
D. Wall
  • 77
  • 1
  • 1
  • 16
0
votes
1 answer

ValueError when running autopep8

I'm trying to run autopep8 recursively in a directory named "tests" with following command: autopep8 --in-place --recursive tests But I'm facing an odd error when running the command: .pyenv/versions/3.11.4/lib/python3.11/configparser.py", line…
Andressa Cabistani
  • 463
  • 1
  • 5
  • 14
0
votes
0 answers

How can I setup a github workflow for my dbt repo with sqlfluff?

I've found a few yml files on line which work, but my sqlfluff linter passes and it shouldn't. This is my first time ever using github workflows and yml, so any advice would be great. I'm sure i'm missing somthing as to why workflow isn't using my…
0
votes
1 answer

Object is possibly 'undefined'. During typescript array assignment and lookup

When I try accessing a variable in an array using array assignment or lookup I get a typescript linting error saying that Object is possibly 'undefined'.ts(2532). I try checking that all of the variables in the operation are not undefined yet that…
Rithwik Babu
  • 104
  • 1
  • 6
0
votes
1 answer

how do linters (flycheck) work with compile_commands file?

How does flycheck or any other linter that uses compile_commands.json find the sources of the standard library? How do they determine the language standard? By the standard flag specified for clang or otherwise? Can I just change this flag in…
0
votes
1 answer

How to configure linter for VSCode with format C++20

I'm using VS Code 1.78.2 with C/C++ extensions on Windows 10 and use MinGW64 for compiling so: $> g++ --version g++ (x86_64-win32-seh-rev1, Built by MinGW-Builds project) 13.1.0 Copyright (C) 2023 Free Software Foundation, Inc. I'm using
Sunchock
  • 361
  • 4
  • 14
0
votes
0 answers

Could not find the '@nrwl/linter:eslint'

i tried to install linter for my angular project but i get this error: Could not find the '@nrwl/linter:eslint' builder's node package. I installed all dependencies. I can't figure out what's wrong. package.json: "devDependencies": { ... …
0
votes
1 answer

How to disable strict_raw_type and inference_failure_on_function_return_type from analysis_option.yaml on Flutter?

I have a lot of warnings with strict_raw_type and inference_failure_on_function_return_type from the dart analyzer. I tried to pass to the analysis_option.yaml the rules: linter: rules: strict_raw_type: false …
Ovidiu Uşvat
  • 701
  • 1
  • 6
  • 29
0
votes
1 answer

How to silence linter for eslint

This is the setting I have in my nvim config file local servers = { 'tsserver', 'eslint', 'bashls' } for _, lsp in ipairs(servers) do lspconfig[lsp].setup { capabilities = capabilities, on_attach = on_attach, …
abbood
  • 23,101
  • 16
  • 132
  • 246
0
votes
0 answers

pnpm rome init throw result.error when is installed Correctly

Hello i installed Rome following the documentation after do: pnpm add --save-dev --save-exact rome it's show me that is installed correctly so i run pnpm rome init and then i have this error by…