Summary
Create a directory with the following files:
pyproject.toml | ruff.toml | test.py |
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "dda"
version = "0.0.1"
requires-python = ">=3.12"
# Comment this out
[tool.ruff.lint]
select = ["I001"]
ignore = ["T201"]
|
# Uncomment
# [lint]
# select = ["I001"]
# ignore = ["T201"]
|
from __future__ import annotations
import tomllib
import requests
def main():
print(tomllib)
print(requests)
if __name__ == "__main__":
main()
|
Then run ruff check . and notice success. Then use the dedicated ruff.toml config file instead and notice that it tries to re-sort the imports because it did not properly read the version from pyproject.toml.
Version
0.9.9