Questions tagged [lint]

Please tag questions about static analysis tools "static-analysis" unless they're actually about the Lint utility. One of the first static analyzers was the Lint utility which appeared in 1979 as part of the Unix 7 distribution kit. Lint was originally used to analyze C source code. This command was so popular that the word "lint" has become the generic term for static analysis tools.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

Pylint issue in Python 3.11

I am getting import error when running lint I am using pylint version 3.0.2 and python version 3.11 Getting the below error from pylint.interfaces import IAstroidChecker, ITokenChecker ImportError: ...
Gokula Kannan's user avatar
0 votes
0 answers
12 views

Using pyproject.toml to define inspection rules of PyCharm

I use PyCharm and have a pyproject.toml, currently configured for flake8. Can I make PyCharm use the ignore list for its own inspections too? My pyproject.toml: [tool.flake8] ignore = [ "I101&...
bugmenot123's user avatar
  • 1,081
0 votes
0 answers
21 views

stylelint - How to validate CSS within Custom XML file

I have a set of xml files which stores the CSS syntax in <CSS> section of the file. I want stylelint to validate that CSS within those files. However, when I run the command npx stylelint /**/*....
Vedant Terkar's user avatar
2 votes
2 answers
65 views

SQL Lint Tests fail if used SYSTEM$GET_PREDECESSOR_RETURN_VALUE

SQL Lint Pipeline fails when I'm trying to publish tasks containing SYSTEM$GET_PREDECESSOR_RETURN_VALUE lines, altough they pass the SQL fluff tests locally on VS Code. Any idea how can i fix these ...
quarrendon's user avatar
2 votes
1 answer
45 views

When a useCallback function is called both by a useEffect and an onClick handler is there a way to have exaustive deps to the useEffect?

I have a pseudo-code React component similar to this one: const codeApplier = ({ code, prices }: Props) => { const [isAccepted, setIsAccepted] = useState(false); const applyCode = useCallback(...
Kida's user avatar
  • 485
0 votes
0 answers
28 views

How to setup sonarlint as a git precommit hook?

I was exploring on linting tools for java and decided to use sonarlint plugin on IntelliJ Idea. Now, I'm finding it difficult on how to integrate sonarlint with a git precommit hook. This is to ...
BooleanUniverse's user avatar
1 vote
1 answer
52 views

TS Lint rule to disallow multiple paramters of the same type

Is there any sort of linter that supports a rule that would disallow the following: function testFn(a: string, b: string) but would allow: function testFn(a: number, b: string) I've seen that eslint ...
Ben Gale's user avatar
  • 5,273
-1 votes
0 answers
8 views

How to use android lint on a folder which just have Android.mk?

I am trying to use Android lint command line tool on a folder which just have Android.mk & other java source code. But don't know how to use it. I am looking for some guide for how to use Android ...
EricNiu's user avatar
1 vote
0 answers
70 views

How to lint GitHub Actions custom action files

When defining workflows for GitHub Actions, you can define custom actions, in order to share logic between workflows. When working a lot on custom action files, having a linter that validate the ...
cmousset's user avatar
  • 675
1 vote
1 answer
50 views

Suppress Javadoc Warnings in Android project with Gradle

I got some troubles with javadoc warnings. When I push my commits and create a pull request in my GitHub repository a Lint Code Base test runs and then shows in the console that a lot of methods and ...
Alfito69420's user avatar
-1 votes
1 answer
52 views

Disable/Forbid Upwards name referencing

Is it possible to disable Upwards name referencing in system-verilog? For example such that a lint error or compilation warning/error is raised if it's used in the source code? Background: Using ...
Moberg's user avatar
  • 5,313
0 votes
1 answer
101 views

SwiftLint doesn't produce any warnings while code has a lot of of them

I've installed SwiftLint 0.53.0 into my pet project: export PATH="$PATH:/opt/homebrew/bin" if which swiftlint > /dev/null; then swiftlint --fix else echo "Error! Swiftlint is ...
Alexey_BH's user avatar
  • 113
0 votes
0 answers
46 views

How to loop in a Yaml file calling SQLFluff lint for each file that has changed

I am answering my own question bc I couldn't find a straight answer anywhere and if I can help others then I can pay back where some have helped me. All of the syntax below has been tested and what I ...
Richard-Notgiven's user avatar
0 votes
0 answers
10 views

ktfmtFix error: "error: expected token: 'context'; generated ( instead"

When running lint on my project I get the following error: error: expected token: 'context'; generated ( instead The error points to this section of code where I'm using the context keyword for ...
Elforama's user avatar
  • 542
0 votes
1 answer
144 views

Ruff doesn't catch undefined argument to function

I'm not sure even if it is ruff's job to catch the undefined argument to a function, but is there a tool that does this? or is there a ruff configuration that I'm missing to add so that ruff can do ...
tandem's user avatar
  • 2,050
-1 votes
1 answer
50 views

Is there any extension available in the Jupyter Notebook for automatically linting the Python code? [closed]

I'm currently using Jupyter Notebook for my Python development work, and I'm looking for a way to automatically lint my Python code within the notebook environment. Linting helps catch syntax errors, ...
Saeed's user avatar
  • 3
0 votes
0 answers
63 views

Using $ref for path parameter in openapi spec yaml causes linting issues in Spectral linter

I get this error when running spectral lint ./openapi/api.yaml path-params Operation must define parameter "{itemUuid}" as expected by path "/item/{itemUuid}/childResource" This ...
orderandchaos_at_work's user avatar
0 votes
1 answer
49 views

Object is possibly 'undefined' should not throw error, since there is a rxjs filter above

I'm currently refactoring a service of mine and came across a rather annoying issue. I have an API which returns a object with multiple optional Properties. When I want to work with the Properties I ...
Felix Riemer's user avatar
0 votes
0 answers
95 views

if statements should only be cuddled with assignments used in the if statement itself

I'm getting a lint error if statements should only be cuddled with assignments used in the if statement itself The linter is marking the line if setToWait { as in bad form. Here's the code: func ...
Ninjaxor's user avatar
  • 912
4 votes
2 answers
81 views

Android Custom Linting half working after publishing on remote repository

I have an android library for which I created 2 linting rules. In the project there are 3 packages, the main one with a sample app, the lib package, and the linting package. The only link between the ...
Adrian Pascu's user avatar
0 votes
0 answers
85 views

TypeScript - deprecation warning 'createNodeArray'

I am currently updating an Angular project to the newest stable version (Angular V16). While doing that I have to uptade the "typescript" version as well. If I update the ts version to 5.x.x ...
Stefan's user avatar
  • 50
2 votes
1 answer
157 views

How to allow 2-line if statements using clang-format

I am working on setting up a style format check for a large library. Currently, our team styleguide prefers that instead of one line if statements, we use a "2 line" statement, which looks ...
Ska's user avatar
  • 29
0 votes
0 answers
67 views

Python Linter or intellisense or pylance in VSCode not working in server path

in the last week, I had a problem with my VsCode, I'm developing Python RPA and the lint (pylance) didn't work in the local server path, does not identify the function, and the possible errors Program ...
Claudinei Gomes's user avatar
0 votes
0 answers
41 views

Eslint configuration very slow

I'm facing an issue with my eslint configurations. When i'm running yarn eslint --cache -c .eslintrc.js './**/*' --ignore-path .eslintignore, my terminal freeze for very long minutes. Could you tell ...
Ludovic WEBER's user avatar
-1 votes
1 answer
52 views

How to type annotate reduce function?

I'm writing a very thin wrapper on top of list and I want to define a method called reduce, but I'm struggling to annotate it properly such that pylance, mypy & pylint cut their complaints ...
Alex's user avatar
  • 606
0 votes
1 answer
606 views

Prettier + ESLint + Turborepo issue

We're adding Turborepo to our existing project since we want to add one more app. Right now we have an issue with ESLint and Prettier. In our pipeline (GitHub Actions) linting fails with the message: ...
vtomic85's user avatar
  • 590
0 votes
1 answer
99 views

How to get lint support for MUI `sx` prop values

I have tried the following approach, but I still don't get any lint support to detect erroneous style property and value. import { SxProps, Theme } from "@mui/material"; export const ...
Sabbir Ahmed's user avatar
  • 1,476
0 votes
0 answers
39 views

Android Lint Error: Missing Class when using XML from library

We are currently getting error when running the Lint using Gradle wrapper command similar to this. The project is running well and has no errors, but we wanted to know if this is a known issue with ...
Bitwise DEVS's user avatar
  • 2,661
1 vote
1 answer
29 views

Does the Flutter Riverpod missing_provider_scope lint rule have any side effects?

Why does the missing_provider_scope Riverpod lint rule exist? Are there any side effects when using it in a deeply nested widget? In following official Riverpod example https://github.com/rrousselGit/...
R2T8's user avatar
  • 2,230
0 votes
0 answers
60 views

How to flag unused imports and fail the build in Android

How do I catch "unused imports" in Java/Kotlin in an Android project? I have this configuration: subprojects { subp -> afterEvaluate { android { lintOptions { ...
rysv's user avatar
  • 2,546
-1 votes
1 answer
29 views

Lint error while running dockerized project on Github Actions

This is the error that I'm getting: (https://i.stack.imgur.com/xNs3G.png) Here is my setup for github actions: --- name: Checks on: [push] jobs: test-lint: name: Test and Lint runs-on: ...
joyal's user avatar
  • 3
0 votes
1 answer
129 views

Ruby on Rails - Rubocop throwing Lint/Syntax: unexpected token tCOMMA

Rubocop is throwing this error: Lint/Syntax: unexpected token tCOMMA (Using Ruby 3.2 parser; configure using TargetRubyVersion parameter, under AllCops) render (:new, status: :...
Ellis Brookes's user avatar
0 votes
0 answers
198 views

SQLFLUFF skips linting macro files

In the last week I've been struggling to understand why SQLFLUFF skips linting macros part of my project. The structure of my project is like this: GCP_Project |- models |- macros |- .sqlfluffignore |-...
Masoud's user avatar
  • 3
0 votes
1 answer
24 views

dart recursive_getter info warning

Insert in the dart pad void main() { print(Foo().bar); } class Foo { bool get bar => bar; } and you will get the warning The getter 'bar' recursively returns itself. Try changing the value ...
jakobleck's user avatar
1 vote
2 answers
43 views

How to solve a problem with a DocblockTypeContradiction in Psalm

I have the simplified code example from my library, to which psalm, for reasons I don't understand, outputs warnings. class Example { public const C_1 = 'val1'; public const C_2 = 'val2'; ...
XYZ's user avatar
  • 165
0 votes
1 answer
439 views

How do I lint .html files of my Angular Project using ESLint in my VSCode

ESLint is already installed in my Angular project and linting all the typescript files. I have also written some set of rules for typescript files to display warnings instead of errors. But the rules ...
T. B. - Tantiya Bichchu's user avatar
1 vote
1 answer
881 views

Error: ESLint couldn't find the config "plugin:@typescript-eslint/recommended-type-checked" to extend from

I've looked around and can't find anything quite matching this, and none of the fixes have solved it for me. I'm relatively new to eslint, and could really use some help. My goal is to turn on the ...
Praxis's user avatar
  • 95
-1 votes
1 answer
289 views

Pre-commit hook skips files in directory

I'm trying to implement SQLFLUFF linter on a certain directory (models/market) on a repo. I'm using this command pre-commit run --files models/market/ what I see is that it is skipping .sql files ...
Masoud's user avatar
  • 3
1 vote
1 answer
34 views

HTML (for angular) validation - different behavior with name and id attributes

I'm trying to get as clean as possible when writing code. My IDE is IntelliJ (ultimate), I activated validation before commit/push. There is a strange behavior that I got there where I cannot pass the ...
B. Bri's user avatar
  • 566
0 votes
0 answers
26 views

How to get eslint score similar to pylint score?

I already created a badge to show my pylint score: Now I would like to do something similar with eslint for my frontend. However, eslint does not seem to calculate a score value by default. => How ...
Stefan's user avatar
  • 10.5k
0 votes
1 answer
110 views

How can I fix this dependancy error when deploying a nextjs 13 app with vercel?

I am trying to deploy my NextJS 13 app with vercel, but I get this error on deploying. In vscode, I have ran the linting and it returned no problems. Also did 'npm run build' in vscode which worked ...
Ethan Beddard's user avatar
4 votes
0 answers
1k views

Trying to change the Ruff default line length

I was recently introduced to Ruff a python linter. I have an existing directory with lots of files. I thought to try it out and made a pyproject.toml file in the directory. I want to set the line-...
Shane S's user avatar
  • 1,884
6 votes
1 answer
3k views

Ruff does not autofix line-too-long violation

I have a python project and I am configuring latest version of ruff for that project for linting and formating purpose. I have the below settings in my pyproject.toml file: [tool.ruff] select = ["...
Sukanya Pai's user avatar
0 votes
0 answers
42 views

Lint to prevent modifying image files

Goal: Prevent replacing (modifying according to git) image files. E.g. if you have logo.jpg, you can't just overwrite it with a new logo.jpg, you have to call the new file logo2.jpg and delete the ...
AnonEMouse's user avatar
0 votes
0 answers
23 views

Lint error : Package not included in Android: java.awt. Referenced from com.sun.jna.Native.AWT

I am getting the following error : FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':libraries:shared:lintDevDebug'. > Lint found errors in ...
MChak's user avatar
  • 31
0 votes
1 answer
53 views

How to pass .gitlab-ci.yml dependencies between steps

My .gitlab-ci.yml looks like this: stages: - Linter install: stage: Linter tags: ['checker'] script: - pip install -r path/to/requirements.txt black: stage: Linter tags: ['checker'] ...
Lis's user avatar
  • 574
2 votes
1 answer
103 views

Allow very long "from .." imports for black in order to stick to max line length?

In our projects instead of using relative imports, we usually create the code as python packages and install them with pip install -e . This is nice and prevents from issues with import errors on ...
Roland Deschain's user avatar
0 votes
0 answers
36 views

Custom lint rule to check 'override' functions in Kotlin

I want to write a custom lint rule to detect 'override' functions in Kotlin. override fun testFunction(test: String) { // function body } I would like to detect whether any function I am traversing ...
pseudobot's user avatar
0 votes
1 answer
701 views

NX: How can I use run-many to run multiple targets?

At present, I run: npx nx run-many --all --skip-nx-cache --parallel --target lint to lint all my projects. But, I would like to run lint and type-check. Something like: npx nx run-many --all --skip-nx-...
shet_tayyy's user avatar
  • 5,456
0 votes
0 answers
93 views

Angular Eslint not working - just high disc usage without any output

Every time I try to run eslint via commandline ng lint nothing happens. The commandline freezes and my disc usage jumps up as far as even possible. Sometimes reading up to 1000MB/sec. It worked a few ...
J-Eibe's user avatar
  • 152

1
2 3 4 5
37