Skip to content

Conversation

@cclauss
Copy link
Contributor

@cclauss cclauss commented Mar 24, 2025

% ruff check --select=ALL --ignore=COM,D,Q,RET,SIM910 --statistics | grep "\[\*\]" | sort -k2

   2	FURB105	[*] print-empty-string
  36	I001   	[*] unsorted-imports
  14	ISC001 	[*] single-line-implicit-string-concatenation
   2	PIE790 	[*] unnecessary-placeholder
   1	PIE808 	[*] unnecessary-range-start
  19	PLR0402	[*] manual-from-import
   8	PLR5501	[*] collapsible-else-if
   6	SIM114 	[*] if-with-same-arms
   6	SIM300 	[*] yoda-conditions
[*] 94 fixable with the `--fix` option

% ruff rule I001

unsorted-imports (I001)

Derived from the isort linter.

Fix is sometimes available.

What it does

De-duplicates, groups, and sorts imports based on the provided isort settings.

Why is this bad?

Consistency is good. Use a common convention for imports to make your code
more readable and idiomatic.

Example

import pandas
import numpy as np

Use instead:

import numpy as np
import pandas

@legendecas legendecas merged commit fabc78c into nodejs:main Mar 27, 2025
40 checks passed
@cclauss cclauss deleted the 2025-03-24 branch March 27, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants