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 deprecation infrastructure #9689

Merged
merged 7 commits into from
Jan 30, 2024
Merged

Add rule deprecation infrastructure #9689

merged 7 commits into from
Jan 30, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jan 29, 2024

Adds a new Deprecated rule group in addition to Stable and Preview.

Deprecated rules:

  • Warn on explicit selection without preview
  • Error on explicit selection with preview
  • Are excluded when selected by prefix with preview

Deprecates TRY200, ANN101, and ANN102 as a proof of concept. We can consider deprecating them separately.

@zanieb zanieb added this to the v0.2.0 milestone Jan 29, 2024
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. (+324 -298 lines in 95 files in 3 projects; 2 project errors; 38 projects unchanged)

pandas-dev/pandas (+304 -284 lines across 86 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~L950

         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")

pandas/init.py~L279

 # Pandas is not (yet) a py.typed library: the public API is determined
 # based on the documentation.
 __all__ = [
-    "NA",
     "ArrowDtype",
     "BooleanDtype",
     "Categorical",

pandas/init.py~L298

     "HDFStore",
     "Index",
     "IndexSlice",
-    "Int8Dtype",
     "Int16Dtype",
     "Int32Dtype",
     "Int64Dtype",
+    "Int8Dtype",
     "Interval",
     "IntervalDtype",
     "IntervalIndex",
     "MultiIndex",
+    "NA",
     "NaT",
     "NamedAgg",
     "Period",

pandas/init.py~L318

     "Timedelta",
     "TimedeltaIndex",
     "Timestamp",
-    "UInt8Dtype",
     "UInt16Dtype",
     "UInt32Dtype",
     "UInt64Dtype",
+    "UInt8Dtype",
     "api",
     "array",
     "arrays",

pandas/init.py~L334

     "errors",
     "eval",
     "factorize",
-    "from_dummies",
     "get_dummies",
+    "from_dummies",
     "get_option",
     "infer_freq",
     "interval_range",

pandas/_libs/init.py~L1

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

pandas/_libs/init.py~L6

     "Timedelta",
     "Timestamp",
     "iNaT",
-    "Interval",
 ]
 
 

pandas/_libs/tslibs/init.py~L1

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

pandas/_testing/asserters.py~L751

         and atol is lib.no_default
     ):
         check_exact = (
-            is_numeric_dtype(left.dtype)
-            and not is_float_dtype(left.dtype)
-            or is_numeric_dtype(right.dtype)
-            and not is_float_dtype(right.dtype)
+            (is_numeric_dtype(left.dtype)
+            and not is_float_dtype(left.dtype))
+            or (is_numeric_dtype(right.dtype)
+            and not is_float_dtype(right.dtype))
         )
     elif check_exact is lib.no_default:
         check_exact = False

pandas/_testing/asserters.py~L908

         and atol is lib.no_default
     ):
         check_exact = (
-            is_numeric_dtype(left.dtype)
-            and not is_float_dtype(left.dtype)
-            or is_numeric_dtype(right.dtype)
-            and not is_float_dtype(right.dtype)
+            (is_numeric_dtype(left.dtype)
+            and not is_float_dtype(left.dtype))
+            or (is_numeric_dtype(right.dtype)
+            and not is_float_dtype(right.dtype))
         )
     elif check_exact is lib.no_default:
         check_exact = False

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/indexes/api.py~L47

 
 
 __all__ = [
-    "CategoricalIndex",
-    "DatetimeIndex",
     "Index",
-    "IntervalIndex",
-    "InvalidIndexError",
     "MultiIndex",
-    "NaT",
-    "PeriodIndex",
+    "CategoricalIndex",
+    "IntervalIndex",
     "RangeIndex",
+    "InvalidIndexError",
     "TimedeltaIndex",
+    "PeriodIndex",
+    "DatetimeIndex",
     "_new_Index",
-    "all_indexes_same",
-    "default_index",
+    "NaT",
     "ensure_index",
     "ensure_index_from_sequences",
     "get_objs_combined_axis",
+    "union_indexes",
     "get_unanimous_names",
+    "all_indexes_same",
+    "default_index",
     "safe_sort_index",
-    "union_indexes",
 ]
 
 

pandas/core/indexes/base.py~L7670

         index_like = list(index_like)
 
     if isinstance(index_like, list):
-        if type(index_like) is not list:
+        if type(index_like) is not list:  # noqa: E721
             # must check for exactly list here because of strict type
             # check in clean_index_list
             index_like = list(index_like)

pandas/core/indexes/range.py~L1039

     @unpack_zerodim_and_defer("__floordiv__")
     def __floordiv__(self, other):
         if is_integer(other) and other != 0:
-            if len(self) == 0 or (self.start % other == 0 and self.step % other == 0):
+            if len(self) == 0 or self.start % other == 0 and self.step % other == 0:
                 start = self.start // other
                 step = self.step // other
                 stop = start + len(self) * step

pandas/core/indexing.py~L1234

         if isinstance(key, bool) and not (
             is_bool_dtype(ax.dtype)
             or ax.dtype.name == "boolean"
-            or isinstance(ax, MultiIndex)
-            and is_bool_dtype(ax.get_level_values(0).dtype)
+            or (
+                isinstance(ax, MultiIndex)
+                and is_bool_dtype(ax.get_level_values(0).dtype)
+            )
         ):
             raise KeyError(
                 f"{key}: boolean label can not be used without a boolean index"

pandas/core/indexing.py~L2128

 
         is_full_setter = com.is_null_slice(pi) or com.is_full_slice(pi, len(self.obj))
 
-        is_null_setter = com.is_empty_slice(pi) or is_array_like(pi) and len(pi) == 0
+        is_null_setter = com.is_empty_slice(pi) or (is_array_like(pi) and len(pi) == 0)
 
         if is_null_setter:
             # no-op, don't cast dtype later

pandas/core/indexing.py~L2761

     """
     Check if the indexer is or contains a dict or set, which is no longer allowed.
     """
-    if (
-        isinstance(key, set)
-        or isinstance(key, tuple)
-        and any(isinstance(x, set) for x in key)
+    if isinstance(key, set) or (
+        isinstance(key, tuple) and any(isinstance(x, set) for x in key)
     ):
         raise TypeError(
             "Passing a set as an indexer is not supported. Use a list instead."
         )
 
-    if (
-        isinstance(key, dict)
-        or isinstance(key, tuple)
-        and any(isinstance(x, dict) for x in key)
+    if isinstance(key, dict) or (
+        isinstance(key, tuple) and any(isinstance(x, dict) for x in key)
     ):
         raise TypeError(
             "Passing a dict as an indexer is not supported. Use a list instead."

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/internals/construction.py~L490

                 else x.copy(deep=True)
                 if (
                     isinstance(x, Index)
-                    or isinstance(x, ABCSeries)
-                    and is_1d_only_ea_dtype(x.dtype)
+                    or (isinstance(x, ABCSeries) and is_1d_only_ea_dtype(x.dtype))
                 )
                 else x
                 for x in arrays

pandas/core/internals/construction.py~L919

 
     # assure that they are of the base dict class and not of derived
     # classes
-    data = [d if type(d) is dict else dict(d) for d in data]  # noqa: E721
+    data = [d if type(d) is dict else dict(d) for d in data]
 
     content = lib.dicts_to_array(data, list(columns))
     return content, columns

pandas/io/excel/init.py~L8

 from pandas.io.excel._util import register_writer
 from pandas.io.excel._xlsxwriter import XlsxWriter as _XlsxWriter
 
-__all__ = ["ExcelFile", "ExcelWriter", "read_excel"]
+__all__ = ["read_excel", "ExcelWriter", "ExcelFile"]
 
 
 register_writer(_OpenpyxlWriter)

pandas/io/excel/_odswriter.py~L270

         style_key = json.dumps(style)
         if style_key in self._style_dict:
             return self._style_dict[style_key]
-        name = f"pd{len(self._style_dict) + 1}"
+        name = f"pd{len(self._style_dict)+1}"
         self._style_dict[style_key] = name
         odf_style = Style(name=name, family="table-cell")
         if "font" in style:

pandas/io/formats/format.py~L562

             result = {}
         elif isinstance(col_space, (int, str)):
             result = {"": col_space}
-            result.update(dict.fromkeys(self.frame.columns, col_space))
+            result.update({column: col_space for column in self.frame.columns})
         elif isinstance(col_space, Mapping):
             for column in col_space.keys():
                 if column not in self.frame.columns and column != "":

pandas/io/formats/style.py~L2450

                 for i, level in enumerate(levels_):
                     styles.append(
                         {
-                            "selector": f"thead tr:nth-child({level + 1}) th",
+                            "selector": f"thead tr:nth-child({level+1}) th",
                             "props": props
                             + (
                                 f"top:{i * pixel_size}px; height:{pixel_size}px; "

pandas/io/formats/style.py~L2461

                 if not all(name is None for name in self.index.names):
                     styles.append(
                         {
-                            "selector": f"thead tr:nth-child({obj.nlevels + 1}) th",
+                            "selector": f"thead tr:nth-child({obj.nlevels+1}) th",
                             "props": props
                             + (
                                 f"top:{(len(levels_)) * pixel_size}px; "

pandas/io/formats/style.py~L2481

                     styles.extend(
                         [
                             {
-                                "selector": f"thead tr th:nth-child({level + 1})",
+                                "selector": f"thead tr th:nth-child({level+1})",
                                 "props": props_ + "z-index:3 !important;",
                             },
                             {

pandas/io/formats/style.py~L4023

         if end > start:
             cell_css += "background: linear-gradient(90deg,"
             if start > 0:
-                cell_css += f" transparent {start * 100:.1f}%, {color} {start * 100:.1f}%,"
-            cell_css += f" {color} {end * 100:.1f}%, transparent {end * 100:.1f}%)"
+                cell_css += f" transparent {start*100:.1f}%, {color} {start*100:.1f}%,"
+            cell_css += f" {color} {end*100:.1f}%, transparent {end*100:.1f}%)"
         return cell_css
 
     def css_calc(x, left: float, right: float, align: str, color: str | list | tuple):

pandas/io/formats/style_render.py~L938

                     idx_len = d["index_lengths"].get((lvl, r), None)
                     if idx_len is not None:  # i.e. not a sparsified entry
                         d["clines"][rn + idx_len].append(
-                            f"\\cline{{{lvln + 1}-{len(visible_index_levels) + data_len}}}"
+                            f"\\cline{{{lvln+1}-{len(visible_index_levels)+data_len}}}"
                         )
 
     def format(

pandas/io/formats/style_render.py~L1192

         data = self.data.loc[subset]
 
         if not isinstance(formatter, dict):
-            formatter = dict.fromkeys(data.columns, formatter)
+            formatter = {col: formatter for col in data.columns}
 
         cis = self.columns.get_indexer_for(data.columns)
         ris = self.index.get_indexer_for(data.index)

pandas/io/formats/style_render.py~L1377

             return self  # clear the formatter / revert to default and avoid looping
 
         if not isinstance(formatter, dict):
-            formatter = dict.fromkeys(levels_, formatter)
+            formatter = {level: formatter for level in levels_}
         else:
             formatter = {
                 obj._get_level_number(level): formatter_

pandas/io/formats/style_render.py~L1827

     """
     # Get initial func from input string, input callable, or from default factory
     if isinstance(formatter, str):
-        func_0 = formatter.format
+        func_0 = lambda x: formatter.format(x)
     elif callable(formatter):
         func_0 = formatter
     elif formatter is None:

pandas/io/formats/style_render.py~L2318

         if value[0] == "#" and len(value) == 7:  # color is hex code
             return command, f"[HTML]{{{value[1:].upper()}}}{arg}"
         if value[0] == "#" and len(value) == 4:  # color is short hex code
-            val = f"{value[1].upper() * 2}{value[2].upper() * 2}{value[3].upper() * 2}"
+            val = f"{value[1].upper()*2}{value[2].upper()*2}{value[3].upper()*2}"
             return command, f"[HTML]{{{val}}}{arg}"
         elif value[:3] == "rgb":  # color is rgb or rgba
             r = re.findall("(?<=\\()[0-9\\s%]+(?=,)", value)[0].strip()

pandas/io/formats/xml.py~L269

         nmsp_dict: dict[str, str] = {}
         if self.namespaces:
             nmsp_dict = {
-                f"xmlns{p if p == '' else f':{p}'}": n
+                f"xmlns{p if p=='' else f':{p}'}": n
                 for p, n in self.namespaces.items()
                 if n != self.prefix_uri[1:-1]
             }

pandas/io/json/init.py~L7

 from pandas.io.json._table_schema import build_table_schema
 
 __all__ = [
-    "build_table_schema",
-    "read_json",
-    "to_json",
     "ujson_dumps",
     "ujson_loads",
+    "read_json",
+    "to_json",
+    "build_table_schema",
 ]

pandas/io/json/_json.py~L373

 
         # TODO: Do this timedelta properly in objToJSON.c See GH #15137
         if (
-            ((obj.ndim == 1)
-            and (obj.name in set(obj.index.names)))
+            (obj.ndim == 1)
+            and (obj.name in set(obj.index.names))
             or len(obj.columns.intersection(obj.index.names))
         ):
             msg = "Overlapping names between the index and columns"

pandas/io/parsers/base_parser.py~L498

                     index_converter = converters.get(self.index_names[i]) is not None
 
             try_num_bool = not (
-                (cast_type and is_string_dtype(cast_type)) or index_converter
+                cast_type and is_string_dtype(cast_type) or index_converter
             )
 
             arr, _ = self._infer_types(

pandas/io/parsers/python_parser.py~L880

             for line in lines
             if (
                 len(line) > 1
-                or (len(line) == 1
-                and (not isinstance(line[0], str) or line[0].strip()))
+                or len(line) == 1
+                and (not isinstance(line[0], str) or line[0].strip())
             )
         ]
         return ret

pandas/io/sql.py~L1904

                 # Type[str], Type[float], Type[int], Type[complex], Type[bool],
                 # Type[object]]]]"; expected type "Union[ExtensionDtype, str,
                 # dtype[Any], Type[object]]"
-                dtype = dict.fromkeys(frame, dtype)  # type: ignore[misc]
+                dtype = {col_name: dtype for col_name in frame}  # type: ignore[misc]
             else:
                 dtype = cast(dict, dtype)
 

pandas/io/sql.py~L2847

                 # Type[str], Type[float], Type[int], Type[complex], Type[bool],
                 # Type[object]]]]"; expected type "Union[ExtensionDtype, str,
                 # dtype[Any], Type[object]]"
-                dtype = dict.fromkeys(frame, dtype)  # type: ignore[misc]
+                dtype = {col_name: dtype for col_name in frame}  # type: ignore[misc]
             else:
                 dtype = cast(dict, dtype)
 

pandas/io/stata.py~L2810

         # ds_format - just use 114
         self._write_bytes(struct.pack("b", 114))
         # byteorder
-        self._write((byteorder == ">" and "\x01") or "\x02")
+        self._write(byteorder == ">" and "\x01" or "\x02")
         # filetype
         self._write("\x01")
         # unused

pandas/io/stata.py~L3351

         # ds_format - 117
         bio.write(self._tag(bytes(str(self._dta_version), "utf-8"), "release"))
         # byteorder
-        bio.write(self._tag((byteorder == ">" and "MSF") or "LSF", "byteorder"))
+        bio.write(self._tag(byteorder == ">" and "MSF" or "LSF", "byteorder"))
         # number of vars, 2 bytes in 117 and 118, 4 byte in 119
         nvar_type = "H" if self._dta_version <= 118 else "I"
         bio.write(self._tag(struct.pack(byteorder + nvar_type, self.nvar), "K"))

pandas/plotting/init.py~L79

 
 __all__ = [
     "PlotAccessor",
-    "andrews_curves",
-    "autocorrelation_plot",
-    "bootstrap_plot",
     "boxplot",
     "boxplot_frame",
     "boxplot_frame_groupby",
-    "deregister_matplotlib_converters",
     "hist_frame",
     "hist_series",
-    "lag_plot",
+    "scatter_matrix",
+    "radviz",
+    "andrews_curves",
+    "bootstrap_plot",
     "parallel_coordinates",
+    "lag_plot",
+    "autocorrelation_plot",
+    "table",
     "plot_params",
-    "radviz",
     "register_matplotlib_converters",
-    "scatter_matrix",
-    "table",
+    "deregister_matplotlib_converters",
 ]

pandas/plotting/_matplotlib/init.py~L74

 
 
 __all__ = [
-    "andrews_curves",
-    "autocorrelation_plot",
-    "bootstrap_plot",
+    "plot",
+    "hist_series",
+    "hist_frame",
     "boxplot",
     "boxplot_frame",
     "boxplot_frame_groupby",
-    "deregister",
-    "hist_frame",
-    "hist_series",
+    "table",
+    "andrews_curves",
+    "autocorrelation_plot",
+    "bootstrap_plot",
     "lag_plot",
     "parallel_coordinates",
-    "plot",
     "radviz",
-    "register",
     "scatter_matrix",
-    "table",
+    "register",
+    "deregister",
 ]

pandas/plotting/_matplotlib/hist.py~L262

 
     @classmethod
     # error: Signature of "_plot" incompatible with supertype "MPLPlot"
-    def _plot(  # type: ignore[override]
+    def _plot(  #  type: ignore[override]
         cls,
         ax: Axes,
         y: np.ndarray,

pandas/testing.py~L13

 __all__ = [
     "assert_extension_array_equal",
     "assert_frame_equal",
-    "assert_index_equal",
     "assert_series_equal",
+    "assert_index_equal",
 ]

pandas/tests/apply/test_frame_apply.py~L211

 def test_apply_broadcast_scalars_axis1(float_frame):
     result = float_frame.apply(np.mean, axis=1, result_type="broadcast")
     m = float_frame.mean(axis=1)
-    expected = DataFrame(dict.fromkeys(float_frame.columns, m))
+    expected = DataFrame({c: m for c in float_frame.columns})
     tm.assert_frame_equal(result, expected)
 
 

pandas/tests/apply/test_frame_apply.py~L238

     )
     m = list(range(len(float_frame.index)))
     expected = DataFrame(
-        dict.fromkeys(float_frame.columns, m),
+        {c: m for c in float_frame.columns},
         dtype="float64",
         index=float_frame.index,
     )

pandas/tests/apply/test_frame_apply.py~L1077

 
 @pytest.mark.parametrize(
     "box",
-    [list, tuple, lambda x: np.array(x, dtype="int64")],
+    [lambda x: list(x), lambda x: tuple(x), lambda x: np.array(x, dtype="int64")],
     ids=["list", "tuple", "array"],
 )
 def test_consistency_for_boxed(box, int_frame_const_col):

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)
 
    ...*[Comment body truncated]*

@timleslie
Copy link

Question: Is there a planned mechanism to explain why a particularly rule was deprecated? It might be helpful for a brief explanation to be available in the docs or a verbose error message.

@charliermarsh
Copy link
Member

Yeah, we should probably add a section to the documentation for that particular rule.

@T-256
Copy link
Contributor

T-256 commented Jan 29, 2024

Question: Is there a planned mechanism to explain why a particularly rule was deprecated? It might be helpful for a brief explanation to be available in the docs or a verbose error message.

Also, it would be nice to mention planned version (if any) of its drop time:
... and planned to completely remove it in v0.3.0

@zanieb
Copy link
Member Author

zanieb commented Jan 29, 2024

Question: Is there a planned mechanism to explain why a particularly rule was deprecated?

Yeah this would be nice. I'm not sure how to do this with our macro but I should try to figure it out.

Also, it would be nice to mention planned version (if any) of its drop time

I don't think we can feasibly include "will be dropped in" versions — they're too likely to go out of date since builds are static. It sounds nice, but hard to maintain.

@zanieb
Copy link
Member Author

zanieb commented Jan 30, 2024

I've added deprecation status messages to:

  • The top of the documentation for the rule
  • The rule table

I've also added specific explanations for the deprecations to each rule's documentation.

table_out.push_str(&format!(
"{SPACER}{FIX_SYMBOL}{SPACER} The rule is automatically fixable by the `--fix` command-line option."
));
table_out.push_str("<br />");
Copy link
Member

Choose a reason for hiding this comment

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

I kind of preferred what we had before over a separate section, but I assume you tried to just extend the previous layout and this looked better?

Copy link
Member Author

@zanieb zanieb Jan 30, 2024

Choose a reason for hiding this comment

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

For the legend specifically? I didn't like how much blank space there was so I tried removing that and it felt awkward. I find having all of sentences weirdly verbose for documenting the meanings of the icons.

One thing we could do here is link to the legend from the icons in the rule table. I've tried clicking them multiple times :D

Copy link
Member

Choose a reason for hiding this comment

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

That's interesting. We could even put it at the bottom I guess.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's focus on this separately #9711

(Flake8Annotations, "101") => (RuleGroup::Stable, rules::flake8_annotations::rules::MissingTypeSelf),
(Flake8Annotations, "102") => (RuleGroup::Stable, rules::flake8_annotations::rules::MissingTypeCls),
(Flake8Annotations, "101") => (RuleGroup::Deprecated, rules::flake8_annotations::rules::MissingTypeSelf),
(Flake8Annotations, "102") => (RuleGroup::Deprecated, rules::flake8_annotations::rules::MissingTypeCls),
Copy link
Member

Choose a reason for hiding this comment

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

I'm less certain on ANN102. I would never enable it myself, but could it have value?

Copy link
Member Author

@zanieb zanieb Jan 30, 2024

Choose a reason for hiding this comment

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

I can't see why. It think the annotations here are either self: Self or cls: type[Self]. Are there situations in which they would differ for the cls case? cc @AlexWaygood

Copy link
Member

@AlexWaygood AlexWaygood Jan 30, 2024

Choose a reason for hiding this comment

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

PEP-673 has a really annoying restriction that says you can't use typing.Self in metaclasses, so you have to use a custom TypeVar for __new__ methods in metaclasses (in typeshed we work around this in a somewhat-hacky way: we have a custom TypeVar that is literally just defined as Self = TypeVar("Self"), and use that for these situations: https://github.com/python/typeshed/blob/3881b1b81a8118aa6fc2d2e9616c8f541e5101ed/stdlib/builtins.pyi#L194-L196)

You also might need to use a custom type variable for cls if you can't use typing.Self for whatever reason -- maybe you support older Pythons and you can't declare a dependency on typing_extensions?

But I agree that this seems like a pretty pointless rule, honestly. The vast majority of the time, you can leave these unannotated, and no type checker is going to care if you leave them unannotated. If you need to annotate cls, you'll know that you need to do so without a lint rule telling you about it, I think

This was referenced Jan 30, 2024
@zanieb zanieb merged commit 3f69fb4 into release/0.2.0 Jan 30, 2024
17 checks passed
@zanieb zanieb deleted the zb/deprecated branch January 30, 2024 17:38
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 Jan 30, 2024
Adds a new `Deprecated` rule group in addition to `Stable` and
`Preview`.

Deprecated rules:
- Warn on explicit selection without preview
- Error on explicit selection with preview
- Are excluded when selected by prefix with preview

Deprecates `TRY200`, `ANN101`, and `ANN102` as a proof of concept. We
can consider deprecating them separately.
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
Adds a new `Deprecated` rule group in addition to `Stable` and
`Preview`.

Deprecated rules:
- Warn on explicit selection without preview
- Error on explicit selection with preview
- Are excluded when selected by prefix with preview

Deprecates `TRY200`, `ANN101`, and `ANN102` as a proof of concept. We
can consider deprecating them separately.
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
Follow-up to #9754 and #9689. Alternative to #9714.

Marks `TRY200` as removed and redirects to `B904` instead of marking as
deprecated and suggesting `B904` instead.
zanieb added a commit that referenced this pull request Feb 1, 2024
Follow-up to #9754 and #9689. Alternative to #9714.
Replaces #7506 and #7507
Same ideas as #9755
Part of #8931
zanieb added a commit that referenced this pull request Feb 1, 2024
Adds a new `Deprecated` rule group in addition to `Stable` and
`Preview`.

Deprecated rules:
- Warn on explicit selection without preview
- Error on explicit selection with preview
- Are excluded when selected by prefix with preview

Deprecates `TRY200`, `ANN101`, and `ANN102` as a proof of concept. We
can consider deprecating them separately.
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
Follow-up to #9754 and #9689. Alternative to #9714.

Marks `TRY200` as removed and redirects to `B904` instead of marking as
deprecated and suggesting `B904` instead.
zanieb added a commit that referenced this pull request Feb 1, 2024
Follow-up to #9754 and #9689. Alternative to #9714.
Replaces #7506 and #7507
Same ideas as #9755
Part of #8931
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.

5 participants