This is an automated email from the ASF dual-hosted git repository.

sanirudh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 9e88018c3a [CI] Update dummy-variable regex for pylint (#17206)
9e88018c3a is described below

commit 9e88018c3a56ab378dd11410a662ed5c3da1f4df
Author: Eric Lunderberg <[email protected]>
AuthorDate: Tue Jul 30 10:45:57 2024 -0500

    [CI] Update dummy-variable regex for pylint (#17206)
    
    Prior to this commit, the regex used for pylint to identify dummy
    variables would correctly identify variables that start with an
    underscore (e.g. `_scale`), unless they have an underscore elsewhere
    in the name (e.g. `_scale_factor`).  This leads to false positives
    from pylint for unused variables, as prefixing a variable with an
    underscore should mark a variable as intentionally unused.
    
    This commit updates the regex in TVM's `pylintrc` to match the current
    default value for `dummy-variables-rgx`, to allow unused variables to
    be named with a leading underscore, even if they also contain another
    underscore.
---
 tests/lint/pylintrc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/lint/pylintrc b/tests/lint/pylintrc
index 3b5e14d15b..90900b9e00 100644
--- a/tests/lint/pylintrc
+++ b/tests/lint/pylintrc
@@ -252,7 +252,7 @@ init-import=no
 
 # A regular expression matching the name of dummy variables (i.e. expectedly
 # not used).
-dummy-variables-rgx=(_+[a-zA-Z0-9]*?$)|dummy
+dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
 
 # List of additional names supposed to be defined in builtins. Remember that
 # you should avoid to define new builtins when possible.

Reply via email to