Skip to content

Commit

Permalink
do not emit unused warning for variables named unused*
Browse files Browse the repository at this point in the history
Cython has its own warning for unused variables, which is enabled with `-Wextra`. However, the warning does not trigger if the variable is named `_` or if the variable name starts with `unused`.
  • Loading branch information
dalcinl authored Nov 26, 2023
1 parent c0a33b2 commit dcf1ff2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cython_lint/cython_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def visit_funcdef(
and _def[0] != func_name
and _def[0] not in [i[0] for i in args]
and not _def[0].startswith('_')
and not _def[0].startswith('unused')
and _def[0] not in global_names
):

Expand Down

0 comments on commit dcf1ff2

Please sign in to comment.