Skip to content

Comments

Enable ruff rules ISC001/ISC002#158

Merged
jaraco merged 1 commit intojaraco:mainfrom
DimitriPapadopoulos:flake8-implicit-str-concat
Feb 27, 2025
Merged

Enable ruff rules ISC001/ISC002#158
jaraco merged 1 commit intojaraco:mainfrom
DimitriPapadopoulos:flake8-implicit-str-concat

Conversation

@DimitriPapadopoulos
Copy link
Contributor

Starting with ruff 0.9.1, they are compatible with the ruff formatter when used together.

Conflicting lint rules

[...]
When using Ruff as a formatter, we recommend avoiding the following lint rules:
[...]
multi-line-implicit-string-concatenation (ISC002) if used without ISC001 and flake8-implicit-str-concat.allow-multiline = false

Copy link
Owner

@jaraco jaraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Love having fewer exceptions. Do we know what impact this might have on downstream packages?

@Avasam
Copy link
Contributor

Avasam commented Feb 27, 2025

Love having fewer exceptions.

It could be squished down to:

	# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
	"W191",
	"D206",
	"D300",
	"Q",
	"COM812",
	"COM819",
  • W: We already use extend-select to only have a subset of preselected W rules that don't interfere with the formatter
  • Q: It's just the entire group anyway

Starting with ruff 0.9.1, they are compatible with the ruff formatter
when used together.
@DimitriPapadopoulos
Copy link
Contributor Author

Indeed, according to the extend-select documentation, the default rules are E4, E7, E9, and F. Rules starting with E1 are not included in that default set. However, what if downstream packages add E1 rules?

For the rest, I'd rather stick to the list in the documentation: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules. I feel it's future-proof (what if new compatible Q rules are added?) and consistent with the documentation.

@DimitriPapadopoulos
Copy link
Contributor Author

@Avasam
Copy link
Contributor

Avasam commented Feb 27, 2025

To your first comment: all very fair. I personally don't really care either way. Just sharing additional info.


Perhaps UP038 should be disabled too. See for example:

Whenever UP as a whole is enabled. Absolutely, yes.

I'm not sure that it fits Jason's vision by adding unnecessary configs "just in case". Especially given that it looks like this rule is on its way for deprecation in Ruff 0.10

@jaraco
Copy link
Owner

jaraco commented Feb 27, 2025

Yes, let's stick to the minimum config that drives toward best practices while avoiding churn. Happy to adopt things early and avoid bringing in debt.

@jaraco jaraco merged commit 8f42595 into jaraco:main Feb 27, 2025
13 of 15 checks passed
@DimitriPapadopoulos DimitriPapadopoulos deleted the flake8-implicit-str-concat branch February 28, 2025 07:29
clrpackages pushed a commit to clearlinux-pkgs/pypi-configparser that referenced this pull request Mar 25, 2025
… version 7.2.0

Anderson Bravalheri (3):
      Add `--fix`  flag to ruff pre-commit hook for automatic suggestion of fixes (jaraco/skeleton#140)
      Bump pre-commit hook for ruff to avoid clashes with pytest-ruff (jaraco/skeleton#150)
      Fix new mandatory configuration field for RTD (jaraco/skeleton#159)

Avasam (6):
      Add Protocols, remove @overload, from `.coveragerc` `exclude_also` (jaraco/skeleton#135)
      Loosen restrictions on mypy (jaraco/skeleton#136)
      Fix an incompatibility (and source of merge conflicts) with projects using Ruff/isort.
      Select Ruff rules for modern type annotations (jaraco/skeleton#160)
      Consistent import sorting (isort) (jaraco/skeleton#157)
      remove extra spaces in ruff.toml (jaraco/skeleton#164)

Dimitri Papadopoulos Orfanos (3):
      Update to the latest ruff version (jaraco/skeleton#137)
      Enable ruff rules ISC001/ISC002 (jaraco/skeleton#158)
      Update to the latest ruff version (jaraco/skeleton#166)

Jason R. Coombs (25):
      Split the test dependencies into four classes (test, cover, type, check). (jaraco/skeleton#139)
      Add upstream and local sections for 'type' extra, since many projects will have 'types-*' dependencies.
      🧎‍♀️ Genuflect to the types.
      🧎‍♀️ Genuflect to the types.
      Disable mypy for now. Ref jaraco/skeleton#143
      Move overload-overlap disablement to its own line for easier diffs and simpler relevant comments.
      Add a degenerate nitpick_ignore for downstream consumers. Add a 'local' comment to delineate where the skeleton ends and the downstream begins.
      Add support for linking usernames.
      Include the trailing slash in disable_error_code(overload-overlap), also required for clean diffs.
      Remove workaround for sphinx-contrib/sphinx-lint#83
      Allow the workflow to be triggered manually.
      Add Python 3.13 and 3.14 into the matrix. (jaraco/skeleton#146)
      Add Python 3.13 and 3.14 into the matrix. (jaraco/skeleton#151)
      Include pyproject.toml in ruff.toml.
      Require Python 3.9 or later now that Python 3.8 is EOL.
      Use extend for proper workaround.
      👹 Feed the hobgoblins (delint).
      Bump badge for 2025.
      Removing dependabot config. Closes jaraco/skeleton#156
      Add support for building lxml on pre-release Pythons.
      Remove pycodestyle warnings, no longer meaningful when using ruff formatter.
      👹 Feed the hobgoblins (delint).
      cpython-v3.14.0a5 rev=3c289d5d1b73
      cpython-main rev=72e5b25efb58
      Finalize
clrpackages pushed a commit to clearlinux-pkgs/pypi-setuptools that referenced this pull request Apr 22, 2025
…version 79.0.0

Anderson Bravalheri (1):
      Remove deprecated license classifier (PEP 639) (jaraco/skeleton#170)

Avasam (1):
      remove extra spaces in ruff.toml (jaraco/skeleton#164)

Dimitri Papadopoulos Orfanos (2):
      Enable ruff rules ISC001/ISC002 (jaraco/skeleton#158)
      Update to the latest ruff version (jaraco/skeleton#166)

Hugo van Kemenade (1):
      Fix typo: pyproject.license -> project.license

Jason R. Coombs (11):
      Remove pycodestyle warnings, no longer meaningful when using ruff formatter.
      Remove workaround and update badge.
      Remove PIP_NO_PYTHON_VERSION_WARNING.
      Extract _resolve_download_filename with test.
      Add a check to ensure the name resolves relative to the tmpdir.
      Extract _sanitize method for sanitizing the filename.
      Rely on re.sub to perform the decision in one expression.
      Add news fragment.
      Bump version: 78.1.0 → 78.1.1
      Removed support for the 'legacy-editable' feature.
      Bump version: 78.1.1 → 79.0.0
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.

3 participants