Skip to content

Commit

Permalink
Fix C0121
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankpatibandla committed Mar 5, 2024
1 parent 0d39605 commit f1618c3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# C0209: Consider using an f-string
# R1710: Either all return statements in a function should return an expression, or none of them should
# W0621: Redefining name from outer scope
# C0121: Comparison to singletons is unnecessary
# W0614: Unused import from wildcard import
# W0401: Wildcard import
# R1725: Super with arguments
Expand Down Expand Up @@ -65,7 +64,7 @@
# R0401: Cyclic import

max-line-length = 120
disable = C0114, C0115, C0116, R0903, C0415, R1705, R0913, W1203, R1729, E1120, E1123, C0209, R1710, W0621, C0121,
disable = C0114, C0115, C0116, R0903, C0415, R1705, R0913, W1203, R1729, E1120, E1123, C0209, R1710, W0621,
W0614, W0401, W1202, W0718, R0914, R1725, R1735, C0411, W0237, W0702, W0223, W0613,
R0912, R0911, W0511, R0902, C0412, C0103, C0301, R1732, R0915, W1514,
E1101, R1734, W1201,
Expand Down
4 changes: 2 additions & 2 deletions pros/cli/click_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ def get_help_record(self, ctx):
class PROSDeprecated(click.Option):
def __init__(self, *args, replacement: str = None, **kwargs):
kwargs['help'] = "This option has been deprecated."
if not replacement==None:
if replacement is not None:
kwargs['help'] += " Its replacement is '--{}'".format(replacement)
super(PROSDeprecated, self).__init__(*args, **kwargs)
self.group = "Deprecated"
self.optiontype = "flag" if str(self.type)=="BOOL" else "switch"
self.to_use = replacement
self.arg = args[0][len(args[0])-1]
self.msg = "The '{}' {} has been deprecated. Please use '--{}' instead."
if replacement==None:
if replacement is None:
self.msg = self.msg.split(".")[0]+"."

def type_cast_value(self, ctx, value):
Expand Down
2 changes: 1 addition & 1 deletion pros/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def version(ctx: click.Context, param, value):


def use_analytics(ctx: click.Context, param, value):
if value == None:
if value is None:
return
touse = not analytics.useAnalytics
if str(value).lower().startswith("t"):
Expand Down
6 changes: 3 additions & 3 deletions pros/cli/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def upload(path: Optional[str], project: Optional[c.Project], port: str, **kwarg
analytics.send("upload")
from pros.serial.devices import vex
from pros.serial.ports import DirectPort
kwargs['ide_version'] = project.kernel if not project==None else "None"
kwargs['ide_version'] = project.kernel if project is not None else "None"
kwargs['ide'] = 'PROS'
if path is None or os.path.isdir(path):
if project is None:
Expand Down Expand Up @@ -126,11 +126,11 @@ def upload(path: Optional[str], project: Optional[c.Project], port: str, **kwarg
}
after_upload_default = 'screen'
#Determine which FTCompleteOption to assign to run_after
if kwargs['after']==None:
if kwargs['after'] is None:
kwargs['after']=after_upload_default
if kwargs['run_after']:
kwargs['after']='run'
elif kwargs['run_screen']==False and not kwargs['run_after']:
elif not kwargs['run_screen'] and not kwargs['run_after']:
kwargs['after']='none'
kwargs['run_after'] = action_to_kwarg[kwargs['after']]
kwargs.pop('run_screen')
Expand Down
4 changes: 2 additions & 2 deletions pros/cli/v5_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def set_variable(variable, value, port):

# Get the connected v5 device
port = resolve_v5_port(port, 'system')[0]
if port == None:
if port is None:
return
device = vex.V5Device(DirectPort(port))
actual_value = device.kv_write(variable, value).decode()
Expand All @@ -318,7 +318,7 @@ def read_variable(variable, port):

# Get the connected v5 device
port = resolve_v5_port(port, 'system')[0]
if port == None:
if port is None:
return
device = vex.V5Device(DirectPort(port))
value = device.kv_read(variable).decode()
Expand Down

0 comments on commit f1618c3

Please sign in to comment.