mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-07 05:26:53 +00:00
Replace if statements with if expressions
This commit is contained in:
parent
9e550df7a0
commit
d6be084d3e
1 changed files with 4 additions and 9 deletions
|
|
@ -72,10 +72,7 @@ class Plugin:
|
||||||
"""Find and parse the group the plugin is in."""
|
"""Find and parse the group the plugin is in."""
|
||||||
if self._group is None:
|
if self._group is None:
|
||||||
name = self.name.split(".", 1)
|
name = self.name.split(".", 1)
|
||||||
if len(name) > 1:
|
self._group = name[0] if len(name) > 1 else NO_GROUP_FOUND
|
||||||
self._group = name[0]
|
|
||||||
else:
|
|
||||||
self._group = NO_GROUP_FOUND
|
|
||||||
if self._group is NO_GROUP_FOUND:
|
if self._group is NO_GROUP_FOUND:
|
||||||
return None
|
return None
|
||||||
return self._group
|
return self._group
|
||||||
|
|
@ -118,11 +115,9 @@ class Plugin:
|
||||||
def plugin_name(self):
|
def plugin_name(self):
|
||||||
"""Return the name of the plugin."""
|
"""Return the name of the plugin."""
|
||||||
if self._plugin_name is None:
|
if self._plugin_name is None:
|
||||||
if self.is_in_a_group():
|
self._plugin_name = (
|
||||||
self._plugin_name = self.group()
|
self.group() if self.is_in_a_group() else self.plugin.name
|
||||||
else:
|
)
|
||||||
self._plugin_name = self.plugin.name
|
|
||||||
|
|
||||||
return self._plugin_name
|
return self._plugin_name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue