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

[pylint] - implement C2701 import-private-name #8903

Closed
wants to merge 4 commits into from

Conversation

diceroll123
Copy link
Contributor

Summary

Implements import-private-name/C2701

See: #970

Test Plan

cargo test and manually

@diceroll123 diceroll123 changed the title [pylint] - implement C2701 [pylint] - implement C2701 import-private-name Nov 29, 2023
Copy link
Contributor

github-actions bot commented Nov 29, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+2524 -0 violations, +0 -0 fixes in 41 projects)

DisnakeDev/disnake (+7 -0 violations, +0 -0 fixes)

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

+ disnake/ext/commands/base_core.py:26:27: PLC2701 Imported private object
+ disnake/ext/commands/base_core.py:26:39: PLC2701 Imported private object
+ disnake/ext/commands/core.py:31:5: PLC2701 Imported private object
+ disnake/ext/commands/core.py:32:5: PLC2701 Imported private object
+ disnake/ext/commands/flags.py:8:27: PLC2701 Imported private object
+ disnake/ext/commands/params.py:41:29: PLC2701 Imported private object
+ docs/extensions/attributetable.py:13:27: PLC2701 Imported private object

aiven/aiven-client (+1 -0 violations, +0 -0 fixes)

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

+ tests/test_cliarg.py:7:6: PLC2701 Imported private module

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

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

+ airflow/api/auth/backend/kerberos_auth.py:55:29: PLC2701 Imported private object
+ airflow/api/common/experimental/mark_tasks.py:24:5: PLC2701 Imported private object
+ airflow/api_connexion/security.py:73:59: PLC2701 Imported private object
+ airflow/api_internal/internal_api_call.py:29:30: PLC2701 Imported private object
+ airflow/auth/managers/fab/decorators/auth.py:31:30: PLC2701 Imported private object
+ airflow/auth/managers/fab/fab_auth_manager.py:86:47: PLC2701 Imported private object
+ airflow/auth/managers/fab/fab_auth_manager.py:86:81: PLC2701 Imported private object
+ airflow/cli/cli_config.py:34:30: PLC2701 Imported private object
+ airflow/cli/commands/db_command.py:33:30: PLC2701 Imported private object
+ airflow/cli/commands/task_command.py:63:49: PLC2701 Imported private object
... 343 additional changes omitted for project

aws/aws-sam-cli (+286 -0 violations, +0 -0 fixes)

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

+ samcli/cli/main.py:10:20: PLC2701 Imported private object
+ samcli/cli/main.py:15:6: PLC2701 Imported from private module
+ samcli/commands/_utils/click_mutex.py:8:6: PLC2701 Imported from private module
+ samcli/commands/_utils/command_exception_handler.py:10:6: PLC2701 Imported from private module
+ samcli/commands/_utils/custom_options/hook_name_option.py:12:6: PLC2701 Imported from private module
+ samcli/commands/_utils/experimental.py:12:6: PLC2701 Imported from private module
+ samcli/commands/_utils/options.py:22:6: PLC2701 Imported from private module
+ samcli/commands/_utils/options.py:28:6: PLC2701 Imported from private module
+ samcli/commands/_utils/options.py:29:6: PLC2701 Imported from private module
+ samcli/commands/_utils/options.py:30:6: PLC2701 Imported from private module
... 276 additional changes omitted for project

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

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

+ docs/bokeh/source/conf.py:15:19: PLC2701 Imported private object
+ src/bokeh/command/bootstrap.py:51:19: PLC2701 Imported private object
+ src/bokeh/command/subcommands/info.py:63:19: PLC2701 Imported private object
+ src/bokeh/protocol/messages/server_info_reply.py:24:19: PLC2701 Imported private object
+ src/bokeh/sphinxext/bokeh_options.py:65:6: PLC2701 Imported from private module
+ src/bokeh/sphinxext/bokeh_prop.py:69:6: PLC2701 Imported from private module
+ src/bokeh/sphinxext/bokeh_releases.py:51:19: PLC2701 Imported private object
+ src/bokeh/sphinxext/bokeh_sampledata_xref.py:39:27: PLC2701 Imported private object
+ src/bokeh/sphinxext/bokeh_settings.py:46:48: PLC2701 Imported private object
+ src/bokeh/sphinxext/bokehjs_content.py:68:27: PLC2701 Imported private object
... 93 additional changes omitted for project

freedomofpress/securedrop (+13 -0 violations, +0 -0 fixes)

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

+ securedrop/manage.py:13:22: PLC2701 Imported private object
+ securedrop/management/submissions.py:6:22: PLC2701 Imported private object
+ securedrop/secure_tempfile.py:3:22: PLC2701 Imported private object
+ securedrop/store.py:10:22: PLC2701 Imported private object
+ securedrop/tests/conftest.py:24:25: PLC2701 Imported private object
+ securedrop/tests/factories.py:12:41: PLC2701 Imported private object
+ securedrop/tests/functional/app_navigators/journalist_app_nav.py:16:6: PLC2701 Imported from private module
+ securedrop/tests/functional/app_navigators/source_app_nav.py:8:6: PLC2701 Imported from private module
+ securedrop/tests/functional/pageslayout/test_source_static_pages.py:6:21: PLC2701 Imported private object
+ securedrop/tests/functional/test_source_warnings.py:7:42: PLC2701 Imported private object
... 3 additional changes omitted for project

fronzbot/blinkpy (+2 -0 violations, +0 -0 fixes)

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

+ blinkpy/blinkpy.py:35:39: PLC2701 Imported private object
+ tests/test_blinkpy.py:14:39: PLC2701 Imported private object

ibis-project/ibis (+87 -0 violations, +0 -0 fixes)

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

+ docs/backends/app/backend_info_app.py:14:18: PLC2701 Imported private object
+ docs/how-to/visualization/example_streamlit_app/example_streamlit_app.py:6:18: PLC2701 Imported private object
+ ibis/backends/base/sql/alchemy/query_builder.py:13:32: PLC2701 Imported private object
+ ibis/backends/base/sql/compiler/query_builder.py:14:75: PLC2701 Imported private object
+ ibis/backends/bigquery/registry.py:24:53: PLC2701 Imported private object
+ ibis/backends/bigquery/tests/unit/test_compiler.py:15:18: PLC2701 Imported private object
+ ibis/backends/bigquery/tests/unit/udf/test_usage.py:9:40: PLC2701 Imported private object
+ ibis/backends/clickhouse/compiler/core.py:30:34: PLC2701 Imported private object
+ ibis/backends/dask/__init__.py:20:39: PLC2701 Imported private object
+ ibis/backends/dask/execution/generic.py:45:5: PLC2701 Imported private object
... 77 additional changes omitted for project

milvus-io/pymilvus (+2 -0 violations, +0 -0 fixes)

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

+ pymilvus/client/grpc_handler.py:11:6: PLC2701 Imported from private module
+ pymilvus/client/prepare.py:7:29: PLC2701 Imported private object

pandas-dev/pandas (+1417 -0 violations, +0 -0 fixes)

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

+ asv_bench/benchmarks/gil.py:32:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/indexing_engines.py:13:6: PLC2701 Imported from private module
+ asv_bench/benchmarks/io/parsers.py:4:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/io/parsers.py:5:9: PLC2701 Imported private object
+ asv_bench/benchmarks/libs.py:10:6: PLC2701 Imported from private module
+ asv_bench/benchmarks/plotting.py:25:35: PLC2701 Imported private object
+ asv_bench/benchmarks/plotting.py:25:6: PLC2701 Imported from private module
+ asv_bench/benchmarks/timeseries.py:17:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/fields.py:3:6: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/normalize.py:2:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/normalize.py:7:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/period.py:22:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/period.py:24:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/period.py:8:6: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/resolution.py:23:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/resolution.py:25:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/tslib.py:31:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/tslib.py:33:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/tz_convert.py:14:10: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/tz_convert.py:18:14: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/tz_convert.py:21:14: PLC2701 Imported from private module
+ asv_bench/benchmarks/tslibs/tz_convert.py:4:6: PLC2701 Imported from private module
+ doc/source/conf.py:23:36: PLC2701 Imported private object
+ generate_version.py:18:16: PLC2701 Imported private module
+ generate_version.py:61:20: PLC2701 Imported private module
+ pandas/__init__.py:140:6: PLC2701 Imported from private module
+ pandas/__init__.py:175:6: PLC2701 Imported from private module
+ pandas/__init__.py:177:6: PLC2701 Imported from private module
... 1389 additional changes omitted for project

... Truncated remaining completed projected reports due to GitHub comment length restrictions

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
PLC2701 2522 2522 0 0 0
F401 2 2 0 0 0

@diceroll123 diceroll123 marked this pull request as draft November 29, 2023 06:35
@tjkuson
Copy link
Contributor

tjkuson commented Nov 29, 2023

There's an old PR (#5920) that implements this rule that hasn't been merged.

@diceroll123
Copy link
Contributor Author

Woop, I should have checked! I concede. 🤣

Thanks for the heads-up, @tjkuson!

@tjkuson
Copy link
Contributor

tjkuson commented Nov 29, 2023

Well, your implementation might be better! Mine is quite old…

@diceroll123
Copy link
Contributor Author

Ah, I looked over yours, it's got things I didn't implement, I prefer yours!

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.

2 participants