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

Add rule removal infrastructure #9691

Merged
merged 13 commits into from
Jan 30, 2024
Merged

Add rule removal infrastructure #9691

merged 13 commits into from
Jan 30, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jan 29, 2024

Similar to #9689 — retains removed rules for better error messages and documentation but removed rules cannot be used in any context.

Removes PLR1706 as a useful test case and something we want to accomplish in #9680 anyway. The rule was in preview so we do not need to deprecate it first.

Closes #9007

Test plan

Rules table Rule page

Copy link
Contributor

github-actions bot commented Jan 29, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check encountered linter errors. (no lint changes; 43 project errors)

DisnakeDev/disnake (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

PostHog/HouseWatch (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

RasaHQ/rasa (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

Snowflake-Labs/snowcli (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

aiven/aiven-client (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

alteryx/featuretools (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

apache/airflow (error)

ruff check --no-cache --exit-zero --output-format concise --no-preview --select ALL

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

aws/aws-sam-cli (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

bloomberg/pytest-memray (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

bokeh/bokeh (error)

ruff check --no-cache --exit-zero --output-format concise --no-preview --select ALL

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

commaai/openpilot (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

demisto/content (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

docker/docker-py (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

freedomofpress/securedrop (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

fronzbot/blinkpy (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

ibis-project/ibis (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

ing-bank/probatus (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

jrnl-org/jrnl (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

latchbio/latch (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

lnbits/lnbits (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

milvus-io/pymilvus (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

mlflow/mlflow (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

model-bakers/model_bakery (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

pandas-dev/pandas (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

prefecthq/prefect (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

pypa/build (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

pypa/cibuildwheel (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

pypa/pip (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

pypa/setuptools (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

python/mypy (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

python/typeshed (error)

ruff check --no-cache --exit-zero --output-format concise --no-preview --select PYI

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

python-poetry/poetry (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

reflex-dev/reflex (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

rotki/rotki (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

scikit-build/scikit-build (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

scikit-build/scikit-build-core (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

sphinx-doc/sphinx (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

spruceid/siwe-py (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

tiangolo/fastapi (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

yandex/ch-backup (error)

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

zulip/zulip (error)

ruff check --no-cache --exit-zero --output-format concise --no-preview --select ALL

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

zanieb/huggingface-notebooks (error)

ruff check --no-cache --exit-zero --output-format concise --no-preview --select A,E703,F704,B015,B018,D100

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

openai/openai-cookbook (error)

ruff check --no-cache --exit-zero --output-format concise --no-preview --select A,E703,F704,B015,B018,D100

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

Linter (preview)

ℹ️ ecosystem check encountered linter errors. (no lint changes; 43 project errors)

DisnakeDev/disnake (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

PostHog/HouseWatch (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

RasaHQ/rasa (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

Snowflake-Labs/snowcli (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

aiven/aiven-client (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

alteryx/featuretools (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

apache/airflow (error)

ruff check --no-cache --exit-zero --output-format concise --preview --select ALL

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

aws/aws-sam-cli (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

bloomberg/pytest-memray (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

bokeh/bokeh (error)

ruff check --no-cache --exit-zero --output-format concise --preview --select ALL

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

commaai/openpilot (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

demisto/content (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

docker/docker-py (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

freedomofpress/securedrop (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

fronzbot/blinkpy (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

ibis-project/ibis (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

ing-bank/probatus (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

jrnl-org/jrnl (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

latchbio/latch (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

lnbits/lnbits (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

milvus-io/pymilvus (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

mlflow/mlflow (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

model-bakers/model_bakery (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

pandas-dev/pandas (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

prefecthq/prefect (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

pypa/build (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

pypa/cibuildwheel (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

pypa/pip (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

pypa/setuptools (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

python/mypy (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

python/typeshed (error)

ruff check --no-cache --exit-zero --output-format concise --preview --select PYI

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

python-poetry/poetry (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

reflex-dev/reflex (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

rotki/rotki (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

scikit-build/scikit-build (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

scikit-build/scikit-build-core (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

sphinx-doc/sphinx (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

spruceid/siwe-py (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

tiangolo/fastapi (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

yandex/ch-backup (error)

ruff check --no-cache --exit-zero --output-format concise --preview

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

zulip/zulip (error)

ruff check --no-cache --exit-zero --output-format concise --preview --select ALL

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

zanieb/huggingface-notebooks (error)

ruff check --no-cache --exit-zero --output-format concise --preview --select A,E703,F704,B015,B018,D100

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

openai/openai-cookbook (error)

ruff check --no-cache --exit-zero --output-format concise --preview --select A,E703,F704,B015,B018,D100

error: invalid value 'concise' for '--output-format <OUTPUT_FORMAT>'
  [possible values: text, json, json-lines, junit, grouped, github, gitlab, pylint, azure, sarif]

For more information, try '--help'.

Formatter (stable)

ℹ️ ecosystem check detected format changes. (+240 -221 lines in 82 files in 2 projects; 2 project errors; 39 projects unchanged)

pandas-dev/pandas (+213 -200 lines across 75 files)

asv_bench/benchmarks/frame_methods.py~L523

         self.df = DataFrame(np.random.randn(1000, 100))
 
         self.s = Series(np.arange(1028.0))
-        self.df2 = DataFrame(dict.fromkeys(range(1028), self.s))
+        self.df2 = DataFrame({i: self.s for i in range(1028)})
         self.df3 = DataFrame(np.random.randn(1000, 3), columns=list("ABC"))
 
     def time_apply_user_func(self):

asv_bench/benchmarks/groupby.py~L511

         # grouping on multiple columns
         # and we lack kernels for a bunch of methods
         if (
-            (engine == "numba"
-            and method in _numba_unsupported_methods)
+            engine == "numba"
+            and method in _numba_unsupported_methods
             or ncols > 1
             or application == "transformation"
             or dtype == "datetime"

asv_bench/benchmarks/groupby.py~L951

         self.df4["jim"] = self.df4["joe"]
 
     def time_transform_lambda_max(self):
-        self.df.groupby(level="lev1").transform(max)
+        self.df.groupby(level="lev1").transform(lambda x: max(x))
 
     def time_transform_str_max(self):
         self.df.groupby(level="lev1").transform("max")

asv_bench/benchmarks/io/csv.py~L337

         if thousands is not None:
             fmt = f":{thousands}"
             fmt = "{" + fmt + "}"
-            df = df.map(fmt.format)
+            df = df.map(lambda x: fmt.format(x))
         df.to_csv(self.fname, sep=sep)
 
     def time_thousands(self, sep, thousands, engine):

asv_bench/benchmarks/io/style.py~L13

     def setup(self, cols, rows):
         self.df = DataFrame(
             np.random.randn(rows, cols),
-            columns=[f"float_{i + 1}" for i in range(cols)],
-            index=[f"row_{i + 1}" for i in range(rows)],
+            columns=[f"float_{i+1}" for i in range(cols)],
+            index=[f"row_{i+1}" for i in range(rows)],
         )
 
     def time_apply_render(self, cols, rows):

pandas/_libs/init.py~L1

 __all__ = [
-    "Interval",
     "NaT",
     "NaTType",
     "OutOfBoundsDatetime",

pandas/_libs/init.py~L7

     "Timedelta",
     "Timestamp",
     "iNaT",
+    "Interval",
 ]
 
 

pandas/_libs/tslibs/init.py~L1

 __all__ = [
-    "BaseOffset",
-    "IncompatibleFrequency",
+    "dtypes",
+    "localize_pydatetime",
     "NaT",
     "NaTType",
+    "iNaT",
+    "nat_strings",
     "OutOfBoundsDatetime",
     "OutOfBoundsTimedelta",
+    "IncompatibleFrequency",
     "Period",
     "Resolution",
-    "Tick",
     "Timedelta",
-    "Timestamp",
-    "add_overflowsafe",
-    "astype_overflowsafe",
-    "delta_to_nanoseconds",
+    "normalize_i8_timestamps",
+    "is_date_array_normalized",
     "dt64arr_to_periodarr",
-    "dtypes",
-    "get_resolution",
-    "get_supported_dtype",
-    "get_unit_from_dtype",
-    "guess_datetime_format",
-    "iNaT",
+    "delta_to_nanoseconds",
     "ints_to_pydatetime",
     "ints_to_pytimedelta",
-    "is_date_array_normalized",
-    "is_supported_dtype",
+    "get_resolution",
+    "Timestamp",
+    "tz_convert_from_utc_single",
+    "tz_convert_from_utc",
+    "to_offset",
+    "Tick",
+    "BaseOffset",
+    "tz_compare",
     "is_unitless",
-    "localize_pydatetime",
-    "nat_strings",
-    "normalize_i8_timestamps",
+    "astype_overflowsafe",
+    "get_unit_from_dtype",
     "periods_per_day",
     "periods_per_second",
-    "to_offset",
-    "tz_compare",
-    "tz_convert_from_utc",
-    "tz_convert_from_utc_single",
+    "guess_datetime_format",
+    "add_overflowsafe",
+    "get_supported_dtype",
+    "is_supported_dtype",
 ]
 
 from pandas._libs.tslibs import dtypes  # pylint: disable=import-self

pandas/api/init.py~L8

 )
 
 __all__ = [
+    "interchange",
     "extensions",
     "indexers",
-    "interchange",
     "types",
     "typing",
 ]

pandas/api/indexers/init.py~L10

 )
 
 __all__ = [
+    "check_array_indexer",
     "BaseIndexer",
     "FixedForwardWindowIndexer",
     "VariableOffsetWindowIndexer",
-    "check_array_indexer",
 ]

pandas/core/_numba/extensions.py~L277

     """Converts numba UnicodeCharSeq (numpy string scalar) -> unicode type (string).
     Is a no-op for other types."""
     if isinstance(x, types.UnicodeCharSeq):
-        return lambda x: str(x)
+        return str
     else:
         return lambda x: x
 

pandas/core/_numba/kernels/init.py~L16

 )
 
 __all__ = [
-    "sliding_mean",
     "grouped_mean",
-    "sliding_sum",
+    "grouped_min_max",
     "grouped_sum",
-    "sliding_var",
     "grouped_var",
+    "sliding_mean",
     "sliding_min_max",
-    "grouped_min_max",
+    "sliding_sum",
+    "sliding_var",
 ]

pandas/core/arrays/init.py~L23

 
 __all__ = [
     "ArrowExtensionArray",
+    "ExtensionArray",
+    "ExtensionOpsMixin",
+    "ExtensionScalarOpsMixin",
     "ArrowStringArray",
     "BaseMaskedArray",
     "BooleanArray",
     "Categorical",
     "DatetimeArray",
-    "ExtensionArray",
-    "ExtensionOpsMixin",
-    "ExtensionScalarOpsMixin",
     "FloatingArray",
     "IntegerArray",
     "IntervalArray",
     "NumpyExtensionArray",
     "PeriodArray",
+    "period_array",
     "SparseArray",
     "StringArray",
     "TimedeltaArray",
-    "period_array",
 ]

pandas/core/arrays/arrow/init.py~L4

 )
 from pandas.core.arrays.arrow.array import ArrowExtensionArray
 
-__all__ = ["ArrowExtensionArray", "StructAccessor", "ListAccessor"]
+__all__ = ["ArrowExtensionArray", "ListAccessor", "StructAccessor"]

pandas/core/arrays/arrow/array.py~L165

         "rmul": lambda x, y: pc.multiply_checked(y, x),
         "truediv": lambda x, y: pc.divide(*cast_for_truediv(x, y)),
         "rtruediv": lambda x, y: pc.divide(*cast_for_truediv(y, x)),
-        "floordiv": lambda x, y: floordiv_compat(x, y),
+        "floordiv": floordiv_compat,
         "rfloordiv": lambda x, y: floordiv_compat(y, x),
         "mod": NotImplemented,
         "rmod": NotImplemented,

pandas/core/arrays/arrow/array.py~L1401

             pa.types.is_floating(pa_type)
             and (
                 na_value is np.nan
-                or original_na_value is lib.no_default
-                and is_float_dtype(dtype)
+                or (original_na_value is lib.no_default and is_float_dtype(dtype))
             )
         ):
             result = data._pa_array.to_numpy()

pandas/core/arrays/arrow/array.py~L2505

 
     def _str_findall(self, pat: str, flags: int = 0) -> Self:
         regex = re.compile(pat, flags=flags)
-        predicate = lambda val: regex.findall(val)
+        predicate = regex.findall
         result = self._apply_elementwise(predicate)
         return type(self)(pa.chunked_array(result))
 

pandas/core/common.py~L144

     elif isinstance(key, list):
         # check if np.array(key).dtype would be bool
         if len(key) > 0:
-            if type(key) is not list:  # noqa: E721
+            if type(key) is not list:
                 # GH#42461 cython will raise TypeError if we pass a subclass
                 key = list(key)
             return lib.is_bool_list(key)

pandas/core/dtypes/common.py~L1676

 
 
 __all__ = [
-    "DT64NS_DTYPE",
-    "INT64_DTYPE",
-    "TD64NS_DTYPE",
     "classes",
+    "DT64NS_DTYPE",
     "ensure_float64",
     "ensure_python_int",
     "ensure_str",
     "infer_dtype_from_object",
+    "INT64_DTYPE",
     "is_1d_only_ea_dtype",
     "is_all_strings",
     "is_any_real_numeric_dtype",

pandas/core/dtypes/common.py~L1729

     "is_unsigned_integer_dtype",
     "needs_i8_conversion",
     "pandas_dtype",
+    "TD64NS_DTYPE",
     "validate_all_hashable",
 ]

pandas/core/dtypes/dtypes.py~L1058

         possible
         """
         if (
-            (isinstance(string, str)
-            and (string.startswith(("period[", "Period["))))
+            isinstance(string, str)
+            and (string.startswith(("period[", "Period[")))
             or isinstance(string, BaseOffset)
         ):
             # do not parse string like U as period[U]

pandas/core/dtypes/dtypes.py~L1711

                 # i.e. we want to treat any floating-point NaN as equal, but
                 # not a floating-point NaN and a datetime NaT.
                 fill_value = (
-                    (other._is_na_fill_value
-                    and isinstance(self.fill_value, type(other.fill_value)))
+                    other._is_na_fill_value
+                    and isinstance(self.fill_value, type(other.fill_value))
                     or isinstance(other.fill_value, type(self.fill_value))
                 )
             else:

pandas/core/internals/init.py~L14

 )
 
 __all__ = [
+    "ArrayManager",
     "Block",  # pylint: disable=undefined-all-variable
+    "BlockManager",
+    "DataManager",
     "DatetimeTZBlock",  # pylint: disable=undefined-all-variable
     "ExtensionBlock",  # pylint: disable=undefined-all-variable
-    "make_block",
-    "DataManager",
-    "ArrayManager",
-    "BlockManager",
-    "SingleDataManager",
-    "SingleBlockManager",
     "SingleArrayManager",
+    "SingleBlockManager",
+    "SingleDataManager",
     "concatenate_managers",
+    "make_block",
 ]
 
 

pandas/core/internals/concat.py~L221

         for i, indexer in indexers.items():
             mgr = mgr.reindex_indexer(
                 axes[i],
-                indexers[i],
+                indexer,
                 axis=i,
                 copy=False,
                 only_slice=True,  # only relevant for i==0

pandas/core/ops/init.py~L65

 __all__ = [
     "ARITHMETIC_BINOPS",
     "arithmetic_op",
-    "comparison_op",
     "comp_method_OBJECT_ARRAY",
-    "invalid_comparison",
+    "comparison_op",
     "fill_binop",
+    "get_array_op",
+    "get_op_result_name",
+    "invalid_comparison",
     "kleene_and",
     "kleene_or",
     "kleene_xor",
     "logical_op",
     "make_flex_doc",
+    "maybe_prepare_scalar_for_op",
     "radd",
     "rand_",
     "rdiv",

pandas/core/ops/init.py~L87

     "rtruediv",
     "rxor",
     "unpack_zerodim_and_defer",
-    "get_op_result_name",
-    "maybe_prepare_scalar_for_op",
-    "get_array_op",
 ]

pandas/tests/apply/test_frame_apply_relabeling.py~L65

             cat=("B", max),
             dat=("C", "min"),
             f=("B", np.sum),
-            kk=("B", min),
+            kk=("B", lambda x: min(x)),
         )
     expected = pd.DataFrame(
         {

pandas/tests/apply/test_series_apply.py~L395

     tm.assert_series_equal(result, expected)
 
 
-@pytest.mark.parametrize("func", [str, str])
+@pytest.mark.parametrize("func", [str, lambda x: str(x)])
 def test_apply_map_evaluate_lambdas_the_same(string_series, func, by_row):
     # test that we are evaluating row-by-row first if by_row="compat"
     # else vectorized evaluation

pandas/tests/apply/test_series_apply.py~L413

     # in the future, the result will be a Series class.
 
     with tm.assert_produces_warning(FutureWarning):
-        result = string_series.agg(type)
+        result = string_series.agg(lambda x: type(x))
     assert isinstance(result, Series) and len(result) == len(string_series)
 
     with tm.assert_produces_warning(FutureWarning):

pandas/tests/apply/test_series_apply.py~L696

 def test_series_apply_unpack_nested_data():
     # GH#55189
     ser = Series([[1, 2, 3], [4, 5, 6, 7]])
-    result = ser.apply(Series)
+    result = ser.apply(lambda x: Series(x))
     expected = DataFrame({0: [1.0, 4.0], 1: [2.0, 5.0], 2: [3.0, 6.0], 3: [np.nan, 7]})
     tm.assert_frame_equal(result, expected)

pandas/tests/arithmetic/test_period.py~L1483

             lambda obj, ng: ng + obj,
             lambda obj, ng: obj - ng,
             lambda obj, ng: ng - obj,
-            lambda obj, ng: np.add(obj, ng),
+            np.add,
             lambda obj, ng: np.add(ng, obj),
-            lambda obj, ng: np.subtract(obj, ng),
+            np.subtract,
             lambda obj, ng: np.subtract(ng, obj),
         ],
     )

pandas/tests/arrays/sparse/test_arithmetics.py~L404

     # GH#27910
     arr = SparseArray([0, 1], fill_value=0)
     df = pd.DataFrame([[1, 2], [3, 4]])
-    result = arr + df
+    result = arr.__add__(df)
     assert result is NotImplemented
 
 

pandas/tests/arrays/string_/test_string.py~L192

 def test_add_strings(dtype):
     arr = pd.array(["a", "b", "c", "d"], dtype=dtype)
     df = pd.DataFrame([["t", "y", "v", "w"]], dtype=object)
-    assert arr + df is NotImplemented
+    assert arr.__add__(df) is NotImplemented
 
     result = arr + df
     expected = pd.DataFrame([["at", "by", "cv", "dw"]]).astype(dtype)

pandas/tests/arrays/string_/test_string.py~L208

     arr = pd.array(["a", "b", np.nan, np.nan], dtype=dtype)
     df = pd.DataFrame([["x", np.nan, "y", np.nan]])
 
-    assert arr + df is NotImplemented
+    assert arr.__add__(df) is NotImplemented
 
     result = arr + df
     expected = pd.DataFrame([["ax", np.nan, np.nan, np.nan]]).astype(dtype)

pandas/tests/base/test_conversion.py~L49

         [
             lambda x: x.tolist(),
             lambda x: x.to_list(),
-            list,
-            lambda x: list(iter(x)),
+            lambda x: list(x),
+            lambda x: list(x.__iter__()),
         ],
         ids=["tolist", "to_list", "list", "iter"],
     )

pandas/tests/base/test_conversion.py~L81

         [
             lambda x: x.tolist(),
             lambda x: x.to_list(),
-            list,
-            lambda x: list(iter(x)),
+            lambda x: list(x),
+            lambda x: list(x.__iter__()),
         ],
         ids=["tolist", "to_list", "list", "iter"],
     )

pandas/tests/base/test_conversion.py~L131

         [
             lambda x: x.tolist(),
             lambda x: x.to_list(),
-            list,
-            lambda x: list(iter(x)),
+            lambda x: list(x),
+            lambda x: list(x.__iter__()),
         ],
         ids=["tolist", "to_list", "list", "iter"],
     )

pandas/tests/copy_view/index/test_timedeltaindex.py~L16

 @pytest.mark.parametrize(
     "cons",
     [
-        TimedeltaIndex,
+        lambda x: TimedeltaIndex(x),
         lambda x: TimedeltaIndex(TimedeltaIndex(x)),
     ],
 )

pandas/tests/copy_view/test_array.py~L15

 
 @pytest.mark.parametrize(
     "method",
-    [lambda ser: ser.values, np.asarray],
+    [lambda ser: ser.values, lambda ser: np.asarray(ser)],
     ids=["values", "asarray"],
 )
 def test_series_values(using_copy_on_write, method):

pandas/tests/copy_view/test_array.py~L45

 
 @pytest.mark.parametrize(
     "method",
-    [lambda df: df.values, np.asarray],
+    [lambda df: df.values, lambda df: np.asarray(df)],
     ids=["values", "asarray"],
 )
 def test_dataframe_values(using_copy_on_write, method):

pandas/tests/copy_view/test_constructors.py~L343

     arr = np.array([[1, 2], [3, 4]])
     df = DataFrame(arr, copy=copy)
 
-    if (using_copy_on_write and copy is not False) or copy is True:
+    if using_copy_on_write and copy is not False or copy is True:
         assert not np.shares_memory(get_array(df, 0), arr)
     else:
         assert np.shares_memory(get_array(df, 0), arr)

pandas/tests/copy_view/test_functions.py~L201

     "func",
     [
         lambda df1, df2, **kwargs: df1.merge(df2, **kwargs),
-        merge,
+        lambda df1, df2, **kwargs: merge(df1, df2, **kwargs),
     ],
 )
 def test_merge_on_key(using_copy_on_write, func):

pandas/tests/copy_view/test_methods.py~L388

         lambda idx: idx,
         lambda idx: idx.view(),
         lambda idx: idx.copy(),
-        list,
+        lambda idx: list(idx),
     ],
     ids=["identical", "view", "copy", "values"],
 )

pandas/tests/dtypes/test_common.py~L119

 }
 
 
-@pytest.mark.parametrize("name1,dtype1", list(dtypes.items()), ids=str)
-@pytest.mark.parametrize("name2,dtype2", list(dtypes.items()), ids=str)
+@pytest.mark.parametrize("name1,dtype1", list(dtypes.items()), ids=lambda x: str(x))
+@pytest.mark.parametrize("name2,dtype2", list(dtypes.items()), ids=lambda x: str(x))
 def test_dtype_equal(name1, dtype1, name2, dtype2):
     # match equal to self, but not equal to other
     assert com.is_dtype_equal(dtype1, dtype1)

pandas/tests/dtypes/test_common.py~L128

         assert not com.is_dtype_equal(dtype1, dtype2)
 
 
-@pytest.mark.parametrize("name,dtype", list(dtypes.items()), ids=str)
+@pytest.mark.parametrize("name,dtype", list(dtypes.items()), ids=lambda x: str(x))
 def test_pyarrow_string_import_error(name, dtype):
     # GH-44276
     assert not com.is_dtype_equal(dtype, "string[pyarrow]")

pandas/tests/dtypes/test_dtypes.py~L227

 
     def test_repr(self):
         cat = Categorical(pd.Index([1, 2, 3], dtype="int32"))
-        result = repr(cat.dtype)
+        result = cat.dtype.__repr__()
         expected = (
             "CategoricalDtype(categories=[1, 2, 3], ordered=False, "
             "categories_dtype=int32)"

pandas/tests/extension/base/getitem.py~L139

                 "index out of bounds",  # pyarrow
                 "Out of bounds access",  # Sparse
                 f"loc must be an integer between -{ub} and {ub}",  # Sparse
-                f"index {ub+1} is out of bounds for axis 0 with size {ub}",
-                f"index -{ub+1} is out of bounds for axis 0 with size {ub}",
+                f"index {ub + 1} is out of bounds for axis 0 with size {ub}",
+                f"index -{ub + 1} is out of bounds for axis 0 with size {ub}",
             ]
         )
         with pytest.raises(IndexError, match=msg):

pandas/tests/groupby/aggregate/test_aggregate.py~L940

             [5.5, 7.5],
         ),
         (
-            (("y", "A"), max),
+            (("y", "A"), lambda x: max(x)),
             (("y", "A"), lambda x: 1),
             (("y", "B"), np.mean),
             [1, 3],

pandas/tests/groupby/aggregate/test_aggregate.py~L1143

         tm.assert_frame_equal(left, right)
 
 
-@pytest.mark.parametrize("func", [lambda s: s.mean(), np.mean, np.nanmean])
+@pytest.mark.parametrize(
+    "func", [lambda s: s.mean(), lambda s: np.mean(s), lambda s: np.nanmean(s)]
+)
 def test_multiindex_custom_func(func):
     # GH 31777
     data = [[1, 4, 2], [5, 7, 1]]

pandas/tests/groupby/aggregate/test_aggregate.py~L1328

             height_sqr_min=("height", lambda x: np.min(x**2)),
             height_max=("height", "max"),
             weight_max=("weight", "max"),
-            height_max_2=("height", np.max),
-            weight_min=("weight", np.min),
+            height_max_2=("height", lambda x: np.max(x)),
+            weight_min=("weight", lambda x: np.min(x)),
         )
         tm.assert_frame_equal(result1, expected)
 

pandas/tests/groupby/aggregate/test_aggregate.py~L1338

             height_sqr_min=pd.NamedAgg(column="height", aggfunc=lambda x: np.min(x**2)),
             height_max=pd.NamedAgg(column="height", aggfunc="max"),
             weight_max=pd.NamedAgg(column="weight", aggfunc="max"),
-            height_max_2=pd.NamedAgg(column="height", aggfunc=np.max),
-            weight_min=pd.NamedAgg(column="weight", aggfunc=np.min),
+            height_max_2=pd.NamedAgg(column="height", aggfunc=lambda x: np.max(x)),
+            weight_min=pd.NamedAgg(column="weight", aggfunc=lambda x: np.min(x)),
         )
         tm.assert_frame_equal(result2, expected)
 

pandas/tests/groupby/aggregate/test_cython.py~L221

     result = g._cython_agg_general(op, alt=None, numeric_only=True)
 
     g = df.groupby(pd.cut(df[0], grps), observed=observed)
-    expected = g.agg(targop)
+    expected = g.agg(lambda x: targop(x))
     tm.assert_frame_equal(result, expected)
 
 

pandas/tests/groupby/aggregate/test_other.py~L402

     equiv_callables = [
         sum,
         np.sum,
-        sum,
+        lambda x: sum(x),
         lambda x: x.sum(),
         partial(sum),
         fn_class(),

pandas/tests/groupby/aggregate/test_other.py~L482

     df = DataFrame({"a": 1, "b": [ts + dt.timedelta(minutes=nn) for nn in range(10)]})
 
     result1 = df.groupby("a")["b"].agg("min").iloc[0]
-    result2 = df.groupby("a")["b"].agg(np.min).iloc[0]
+    result2 = df.groupby("a")["b"].agg(lambda x: np.min(x)).iloc[0]
     result3 = df.groupby("a")["b"].min().iloc[0]
 
     assert result1 == ts

pandas/tests/groupby/aggregate/test_other.py~L544

     [
         (tuple, tuple),
         (list, list),
-        (tuple, tuple),
-        (list, list),
+        (lambda x: tuple(x), tuple),
+        (lambda x: list(x), list),
     ],
 )
 def test_agg_structs_dataframe(structure, cast_as):

pandas/tests/groupby/aggregate/test_other.py~L566

     [
         (tuple, tuple),
         (list, list),
-        (tuple, tuple),
-        (list, list),
+        (lambda x: tuple(x), tuple),
+        (lambda x: list(x), list),
     ],
 )
 def test_agg_structs_series(structure, cast_as):

pandas/tests/groupby/aggregate/test_other.py~L604

     # GH 18473
     df = DataFrame({"A": [str(x) for x in range(3)], "B": [str(x) for x in range(3)]})
     grouped = df.groupby("A", as_index=False, sort=False)
-    result = grouped.agg({"B": list})
+    result = grouped.agg({"B": lambda x: list(x)})
     expected = DataFrame(
         {"A": [str(x) for x in range(3)], "B": [[str(x)] for x in range(3)]}
     )

pandas/tests/groupby/test_apply.py~L1593

     tm.assert_frame_equal(result, expected)
 
     with tm.assert_produces_warning(DeprecationWarning, match=msg):
-        expected2 = gb.apply(npfunc)
+        expected2 = gb.apply(lambda x: npfunc(x))
     tm.assert_frame_equal(result, expected2)
 
     if f != sum:

pandas/tests/groupby/test_categorical.py~L144

         result = df.a.groupby(c, observed=False).transform(sum)
     tm.assert_series_equal(result, df["a"])
 
-    tm.assert_series_equal(df.a.groupby(c, observed=False).transform(np.sum), df["a"])
+    tm.assert_series_equal(
+        df.a.groupby(c, observed=False).transform(lambda xs: np.sum(xs)), df["a"]
+    )
     msg = "using DataFrameGroupBy.sum"
     with tm.assert_produces_warning(FutureWarning, match=msg):
         # GH#53425

pandas/tests/groupby/test_categorical.py~L162

         # GH#53425
         result3 = gbc.transform(max)
     result4 = gbc.transform(np.maximum.reduce)
-    result5 = gbc.transform(np.maximum.reduce)
+    result5 = gbc.transform(lambda xs: np.maximum.reduce(xs))
     tm.assert_frame_equal(result2, df[["a"]], c...*[Comment body truncated]*

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

That's nice!

@charliermarsh
Copy link
Member

Although, we should also remove the files and tests for the rule. And we should probably ensure it doesn't end up in the docs?

fn parse_and_or_ternary(bool_op: &ExprBoolOp) -> Option<(&Expr, &Expr, &Expr)> {
if bool_op.op != BoolOp::Or {
return None;
unreachable!("PLR1706 has been removed");
Copy link
Member Author

Choose a reason for hiding this comment

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

Can we get rid of more here? I'm not sure.

@@ -26,6 +27,9 @@ fn generate_table(table_out: &mut String, rules: impl IntoIterator<Item = Rule>,
table_out.push('\n');
for rule in rules {
let status_token = match rule.group() {
RuleGroup::Removed => {
format!("<span title='Rule has been removed'>{REMOVED_SYMBOL}</span>")
}
Copy link
Member

Choose a reason for hiding this comment

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

My vote would be to remove rules from this table entirely. What's the motivation for keeping them around?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think there's another way to navigate to them. The motivation for keeping them is to

  1. Document why they were removed
  2. Provide a reference for people on previous versions of Ruff

I don't think I expect to keep them around forever; this was an easy path forward though. When we do rule recategorization (#1774), I think we should look at this again?

Copy link
Member

Choose a reason for hiding this comment

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

It seems fair to me to list the rules here when we document the removal on the details page. I do see this as obsolete if we have a versioned documentation.

You may want to consider listing these rules last and designing them visually less prominent (e.g., graying them out).

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to gray them out but it actually seems like a huge pain to do it inside the markdown table. I think this will become obsolete when we do more work on the documentation but I do not think now is the time to try to build that out.

This was referenced Jan 30, 2024
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Could you add two screenshots of the documentation to your test plan:

  1. showing the generated rules table
  2. the details page

crates/ruff_dev/src/generate_docs.rs Outdated Show resolved Hide resolved
@@ -26,6 +27,9 @@ fn generate_table(table_out: &mut String, rules: impl IntoIterator<Item = Rule>,
table_out.push('\n');
for rule in rules {
let status_token = match rule.group() {
RuleGroup::Removed => {
format!("<span title='Rule has been removed'>{REMOVED_SYMBOL}</span>")
}
Copy link
Member

Choose a reason for hiding this comment

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

It seems fair to me to list the rules here when we document the removal on the details page. I do see this as obsolete if we have a versioned documentation.

You may want to consider listing these rules last and designing them visually less prominent (e.g., graying them out).

crates/ruff_workspace/src/configuration.rs Outdated Show resolved Hide resolved
}

fn fix_title(&self) -> Option<String> {
Some(format!("Convert to if-else expression"))
Copy link
Member

Choose a reason for hiding this comment

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

I remember that this needs to be a format! call because we extract it somewhere (or was it message). @charliermarsh do you remember the details? Do we need to preserve the message and fix_title?

Copy link
Member Author

Choose a reason for hiding this comment

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

It needs to be a format! call for the derive_message_formats macro but I've hard-coded the message formats.

@zanieb
Copy link
Member Author

zanieb commented Jan 30, 2024

@MichaReiser added those — I'm not in love with them but I think they're a good incremental step forward.

@MichaReiser
Copy link
Member

Thank you @zanieb.

What do you think of crossing out the rule names for rules that have been removed? The icon is very distant and hard to spot.

E.g. and-or-tenary

@zanieb
Copy link
Member Author

zanieb commented Jan 30, 2024

@MichaReiser I guess that's an option. Could I populate the message section instead? e.g. "This rule has been removed"?

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

@MichaReiser I guess that's an option. Could I populate the message section instead? e.g. "This rule has been removed"?

My preferred solution would be to have both but we can iterate on this later.

@zanieb
Copy link
Member Author

zanieb commented Jan 30, 2024

Here's the latest rule table Screenshot 2024-01-30 at 11 36 16

Base automatically changed from zb/deprecated to release/0.2.0 January 30, 2024 17:38
@zanieb zanieb enabled auto-merge (squash) January 30, 2024 17:39
@zanieb zanieb merged commit 1a485b5 into release/0.2.0 Jan 30, 2024
16 checks passed
@zanieb zanieb deleted the zb/removed branch January 30, 2024 17:45
zanieb added a commit that referenced this pull request Jan 30, 2024
Similar to #9689 — retains removed
rules for better error messages and documentation but removed rules
_cannot_ be used in any context.

Removes PLR1706 as a useful test case and something we want to
accomplish in #9680 anyway. The rule was in preview so we do not need to
deprecate it first.

Closes #9007

## Test plan

<img width="1110" alt="Rules table"
src="https://github.com/astral-sh/ruff/assets/2586601/ac9fa682-623c-44aa-8e51-d8ab0d308355">

<img width="1110" alt="Rule page"
src="https://github.com/astral-sh/ruff/assets/2586601/05850b2d-7ca5-49bb-8df8-bb931bab25cd">
zanieb added a commit that referenced this pull request Feb 1, 2024
Updated implementation of #7369
which was left out in the cold.

This was motivated again following changes in #9691 and #9689 where we
could not test the changes without actually deprecating or removing
rules.

---

Follow-up to discussion in #7210

Moves integration tests from using rules that are transitively in
nursery / preview groups to dedicated test rules that only exist during
development. These rules always raise violations (they do not require
specific file behavior). The rules are not available in production or in
the documentation.

Uses features instead of `cfg(test)` for cross-crate support per
rust-lang/cargo#8379
zanieb added a commit that referenced this pull request Feb 1, 2024
Similar to #9689 — retains removed
rules for better error messages and documentation but removed rules
_cannot_ be used in any context.

Removes PLR1706 as a useful test case and something we want to
accomplish in #9680 anyway. The rule was in preview so we do not need to
deprecate it first.

Closes #9007

## Test plan

<img width="1110" alt="Rules table"
src="https://github.com/astral-sh/ruff/assets/2586601/ac9fa682-623c-44aa-8e51-d8ab0d308355">

<img width="1110" alt="Rule page"
src="https://github.com/astral-sh/ruff/assets/2586601/05850b2d-7ca5-49bb-8df8-bb931bab25cd">
zanieb added a commit that referenced this pull request Feb 1, 2024
zanieb added a commit that referenced this pull request Feb 1, 2024
Similar to #9689 — retains removed
rules for better error messages and documentation but removed rules
_cannot_ be used in any context.

Removes PLR1706 as a useful test case and something we want to
accomplish in #9680 anyway. The rule was in preview so we do not need to
deprecate it first.

Closes #9007

## Test plan

<img width="1110" alt="Rules table"
src="https://github.com/astral-sh/ruff/assets/2586601/ac9fa682-623c-44aa-8e51-d8ab0d308355">

<img width="1110" alt="Rule page"
src="https://github.com/astral-sh/ruff/assets/2586601/05850b2d-7ca5-49bb-8df8-bb931bab25cd">
zanieb added a commit that referenced this pull request Feb 1, 2024
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