Skip to content

Commit

Permalink
sagemathgh-39105: two more ruff checks activated
Browse files Browse the repository at this point in the history
    
one of them fixed here ; also sorting the list of ignored checks

### 📝 Checklist

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
    
URL: sagemath#39105
Reported by: Frédéric Chapoton
Reviewer(s): Tobias Diez
  • Loading branch information
Release Manager committed Dec 10, 2024
2 parents 17e919d + a89a3ca commit 6581ac2
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,7 @@ def __init__(self, *args):
"""
data = args
if len(data) < 2 or not all(isinstance(comp, QuiverMutationType_Irreducible) for comp in data):
return _mutation_type_error(data)
_mutation_type_error(data)

# _info is initialized
self._info = {}
Expand Down
4 changes: 2 additions & 2 deletions src/sage/combinat/finite_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -14717,7 +14717,7 @@ def __init__(self, *args, **kwargs):
self.TapeCache = _FSMTapeCacheDetectEpsilon_
self.visited_states = {}
kwargs['check_epsilon_transitions'] = False
return super().__init__(*args, **kwargs)
super().__init__(*args, **kwargs)

def _push_branch_(self, state, tape_cache, outputs):
"""
Expand Down Expand Up @@ -14842,7 +14842,7 @@ def __init__(self, *args, **kwargs):
self.TapeCache = _FSMTapeCacheDetectAll_
self.visited_states = {}
kwargs['check_epsilon_transitions'] = False
return super().__init__(*args, **kwargs)
super().__init__(*args, **kwargs)


# ****************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions src/sage/groups/misc_gps/argument_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ def __init__(self, category):
Rational Field
"""
from sage.rings.rational_field import QQ
return super().__init__(base=QQ, category=category)
super().__init__(base=QQ, category=category)

def _repr_(self):
r"""
Expand Down Expand Up @@ -1626,7 +1626,7 @@ def __init__(self, category):
sage: S.base() # indirect doctest
<class 'int'>
"""
return super().__init__(base=int, category=category)
super().__init__(base=int, category=category)

def _repr_(self):
r"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/arithgroup/congroup_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def __init__(self, *args, **kwds):
sage: sage.modular.arithgroup.congroup_generic.CongruenceSubgroup(5) # indirect doctest
Generic congruence subgroup of level 5
"""
return CongruenceSubgroupBase.__init__(self, *args, **kwds)
CongruenceSubgroupBase.__init__(self, *args, **kwds)

def _repr_(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/repl/ipython_kernel/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def __init__(self, *args, **kwds):
<... 'dict'>
"""
self.__transform = kwds.pop("transform", None)
return super().__init__(*args, **kwds)
super().__init__(*args, **kwds)

def get_value(self):
"""
Expand Down
3 changes: 1 addition & 2 deletions src/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ passenv = RUFF_OUTPUT_FORMAT
# 12 F811 [*] Redefinition of unused `CompleteDiscreteValuationRings` from line 49
# 8 PLC0414 [*] Import alias does not rename original package
# 7 E743 [ ] Ambiguous function name: `I`
# 7 PLE0101 [ ] Explicit return in `__init__`
# 7 PLR0124 [ ] Name compared with itself, consider replacing `a == a`
# 5 PLW0127 [ ] Self-assignment of variable `a`
# 4 F541 [*] f-string without any placeholders
Expand All @@ -314,7 +313,7 @@ passenv = RUFF_OUTPUT_FORMAT
# 1 F402 [ ] Import `factor` from line 259 shadowed by loop variable
# 1 PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
#
commands = ruff check --ignore PLR2004,I001,F401,E741,F821,PLR0912,PLR0913,E402,PLR0915,PLW2901,PLR5501,PLR0911,E731,F405,PLR1714,PLR1736,F403,PLR0402,PLW0603,F841,PLW0602,PLW0642,PLR1711,SIM101,PLR1704,PLW3301,PLW1510,E721,PLW0211,PLW0120,F811,PLC2401,PLC0414,E743,PLE0101,PLR0124,PLW0127,F541,PLW1508,PLC3002,E742,PLE0302,PLW0129,F402,PLC0208,PLC0206 {posargs:{toxinidir}/sage/}
commands = ruff check --ignore E402,E721,E731,E741,E742,E743,F401,F402,F403,F405,F541,F811,F821,F841,I001,PLC0206,PLC0208,PLC0414,PLC2401,PLC3002,PLE0302,PLR0124,PLR0402,PLR0911,PLR0912,PLR0913,PLR0915,PLR1704,PLR1711,PLR1714,PLR1736,PLR2004,PLR5501,PLW0120,PLW0127,PLW0129,PLW0211,PLW0602,PLW0603,PLW0642,PLW1508,PLW1510,PLW2901,PLW3301 {posargs:{toxinidir}/sage/}

[flake8]
rst-roles =
Expand Down

0 comments on commit 6581ac2

Please sign in to comment.