[flake8-pyi] Implement PYI046 (#6098)

## Summary
Checks for the presence of unused private `typing.Protocol` definitions.

ref #848 

## Test Plan

Snapshots and manual runs of flake8.
This commit is contained in:
Victor Hugo Gomes 2023-07-26 23:34:56 -03:00 committed by GitHub
parent d04367a042
commit 86539c1fc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 148 additions and 4 deletions

View file

@ -94,9 +94,9 @@ impl<'a> Binding<'a> {
)
}
/// Return `true` if this [`Binding`] represents an private variable
/// Return `true` if this [`Binding`] represents an private declaration
/// (e.g., `_x` in `_x = "private variable"`)
pub const fn is_private_variable(&self) -> bool {
pub const fn is_private_declaration(&self) -> bool {
self.flags.contains(BindingFlags::PRIVATE_DECLARATION)
}