Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter should respect extend-ignore #8222

Closed
tinovyatkin opened this issue Oct 25, 2023 · 6 comments
Closed

Formatter should respect extend-ignore #8222

tinovyatkin opened this issue Oct 25, 2023 · 6 comments
Labels
needs-info More information is needed from the issue author

Comments

@tinovyatkin
Copy link

ruff 0.1.2 emits warning warning: The following rules may cause conflicts when used with the formatter: 'D206', 'ISC001', 'Q000', 'Q001', 'Q002', 'Q003'. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the selectorextend-selectconfiguration, or adding then to theignore configuration. even while I have all those rules in extend-ignore

@charliermarsh
Copy link
Member

Are you able to post your complete configuration file?

@charliermarsh charliermarsh added the needs-info More information is needed from the issue author label Oct 25, 2023
@tinovyatkin
Copy link
Author

ruff related config part:

[tool.ruff]
line-length = 110
unfixable = [ ]
extend-exclude = [ ".egg*", "build", "private" ]
extend-select = [
  "B",
  "C4",
  "D101",
  "D106",
  "D2",
  "D3",
  "D400",
  "D402",
  "D403",
  "D412",
  "D419",
  "I",
  "ICN",
  "N",
  "PGH",
  "PIE",
  "PT",
  "PTH",
  "Q",
  "RUF",
  "RUF100",
  "SIM",
  "TCH",
  "TID",
  "UP"
]
extend-ignore = [
  "COM812",
  "COM819",
  "D203",
  "D205",
  "D206",
  "D212",
  "D213",
  "D214",
  "D215",
  "D300",
  "E111",
  "E114",
  "E117",
  "E731",
  "ISC001",
  "ISC002",
  "Q000",
  "Q001",
  "Q002",
  "Q003",
  "RUF012",
  "W191"
]

  [tool.ruff.isort]
  required-imports = [ "from __future__ import annotations" ]
  combine-as-imports = true
  section-order = [
  "future",
  "standard-library",
  "tests",
  "cdk",
  "glue",
  "lambda",
  "glue-preinstalled",
  "third-party",
  "first-party",
  "local-folder"
]

    [tool.ruff.isort.sections]
    glue = [ "awsglue", "pyspark", "ray" ]
    glue-preinstalled = [
  "boto3",
  "botocore",
  "fsspec",
  "matplotlib",
  "mpmath",
  "numpy",
  "pandas",
  "pyarrow",
  "PyMySQL",
  "pyparsing",
  "python-dateutil",
  "pytz",
  "PyYAML",
  "regex",
  "requests",
  "s3fs",
  "sympy"
]
    cdk = [ "aws_cdk", "constructs" ]
    lambda = [ "aws_lambda_powertools", "aws_lambda_typing" ]
    tests = [ "pytest", "moto", "mock", "unittest", "syrupy" ]

[tool.ruff.flake8-import-conventions.extend-aliases]
awswrangler = "wr"
aws_cdk = "cdk"

  [tool.ruff.flake8-type-checking]
  exempt-modules = [
  "typing",
  "typing_extensions",
  "awsglue",
  "pyspark",
  "ray",
  "aws_cdk",
  "constructs",
  "aws_lambda_typing",
  "aws_lambda_powertools"
]

@tinovyatkin
Copy link
Author

Ok, I see #8243 - will switch our config to not use extend-ignore, but a better error / handling of it in this part would be helpful.

@charliermarsh
Copy link
Member

@tinovyatkin - It actually should work interchangeably. Did changing to ignore fix this for you?

@tinovyatkin
Copy link
Author

Yes, changing to ignore removing the warning.

@charliermarsh
Copy link
Member

They should be interchangeable -- extend-ignore is deprecated but still supported. I've updated the docs, but I did also test your configuration and don't see any warnings locally 🤔

charliermarsh pushed a commit that referenced this issue Oct 28, 2023
## Summary

Closes #8243

I'm not sure about #8222. formatter conflicts warning should include
deprecations happened before warning implementation?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info More information is needed from the issue author
Projects
None yet
Development

No branches or pull requests

2 participants