Skip to content

Comments

Make unused variable pattern configurable#265

Merged
charliermarsh merged 16 commits intoastral-sh:mainfrom
harupy:dummy_variable_rgx
Sep 24, 2022
Merged

Make unused variable pattern configurable#265
charliermarsh merged 16 commits intoastral-sh:mainfrom
harupy:dummy_variable_rgx

Conversation

@harupy
Copy link
Contributor

@harupy harupy commented Sep 24, 2022

Resolve #134.

src/settings.rs Outdated
]
});

static DEFAULT_DUMMY_VARIABLE_RGX: Lazy<Regex> = Lazy::new(|| Regex::new("^_$").unwrap());
Copy link
Member

Choose a reason for hiding this comment

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

Should we make this _+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ to match Pylint?

Copy link
Member

Choose a reason for hiding this comment

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

(Will make this change then merge.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that sounds good to me :)

Copy link
Member

Choose a reason for hiding this comment

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

(A went for something in-between -- I think dummy and ignored and unused are a bit odd as defaults.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense!

@charliermarsh
Copy link
Member

Looks great!

@charliermarsh charliermarsh merged commit dce86e0 into astral-sh:main Sep 24, 2022
snowsignal pushed a commit that referenced this pull request Apr 29, 2024
Add missing error codes, use doc comments for all of them.
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.

Make throwaway variable (_) pattern configurable

2 participants