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

[refurb] Implement metaclass_abcmeta (FURB180) #9658

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

alex-700
Copy link
Contributor

Summary

Implement use-abc-shorthand (FURB180) lint.

I changed the name to be more conformant with ruff rule-naming rules.

Test Plan

cargo test

Copy link
Contributor

github-actions bot commented Jan 27, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+59 -0 violations, +0 -0 fixes in 4 projects; 39 projects unchanged)

apache/airflow (+6 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview --select ALL

+ airflow/metrics/validators.py:239:21: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ airflow/models/baseoperatorlink.py:31:24: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ airflow/models/taskmixin.py:146:32: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ airflow/operators/python.py:308:53: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ airflow/providers/apache/beam/operators/beam.py:52:25: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ dev/breeze/src/airflow_breeze/utils/parallel.py:112:35: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class

bokeh/bokeh (+5 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview --select ALL

+ src/bokeh/application/application.py:266:21: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ src/bokeh/application/application.py:286:22: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ src/bokeh/client/states.py:62:13: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ src/bokeh/colors/color.py:54:27: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ src/bokeh/command/subcommand.py:78:18: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class

rotki/rotki (+45 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview

+ rotkehlchen/accounting/cost_basis/base.py:126:27: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/accounting/mixins/event.py:28:28: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/assets/asset.py:221:35: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/assets/asset.py:238:45: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/assets/asset.py:248:41: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/arbitrum_one/decoding/interfaces.py:7:50: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/ethereum/interfaces/balances.py:36:27: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/accounting/interfaces.py:22:33: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/cowswap/decoder.py:47:46: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/cowswap/interfaces.py:25:47: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/decoder.py:120:29: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/decoder.py:990:63: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/eas/decoder.py:34:42: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/gitcoin/decoder.py:44:48: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/interfaces.py:131:52: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/interfaces.py:180:30: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/interfaces.py:190:59: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/interfaces.py:254:73: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/interfaces.py:37:24: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/oneinch/decoder.py:24:46: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/oneinch/v4/decoder.py:39:52: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/decoding/xdai_bridge/decoder.py:31:49: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/manager.py:20:18: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/node_inquirer.py:176:23: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/tokens.py:118:17: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/tokens.py:390:39: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/evm/transactions.py:41:23: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/optimism_superchain/decoding/decoder.py:24:67: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/optimism_superchain/etherscan.py:18:46: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/optimism_superchain/node_inquirer.py:23:51: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/optimism_superchain/node_inquirer.py:71:107: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/chain/optimism_superchain/transactions.py:23:55: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/data_import/importers/binance.py:50:20: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/data_import/importers/binance.py:56:40: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/data_import/importers/binance.py:88:42: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/data_import/utils.py:21:28: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/db/filtering.py:1136:63: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ rotkehlchen/db/filtering.py:291:21: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
... 7 additional changes omitted for project

zulip/zulip (+3 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview --select ALL

+ zerver/lib/notes.py:11:41: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ zerver/lib/outgoing_webhook.py:28:39: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
+ zerver/lib/queue.py:34:38: FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
FURB180 59 59 0 0 0

@charliermarsh charliermarsh self-requested a review January 31, 2024 22:05
@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Jan 31, 2024
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.

Looks great!

@charliermarsh charliermarsh enabled auto-merge (squash) January 31, 2024 22:24
@charliermarsh charliermarsh enabled auto-merge (squash) January 31, 2024 22:25
@charliermarsh
Copy link
Member

Nice work, really thorough.

.is_some_and(|call_path| matches!(call_path.as_slice(), ["abc", "ABCMeta"]))
{
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

I split this condition out of the find_position, I found it a little easier to read them when enforced separately.

@charliermarsh charliermarsh merged commit 2cc8acb into astral-sh:main Jan 31, 2024
16 checks passed
@alex-700 alex-700 deleted the latyshev/furb180 branch February 3, 2024 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants