1
0
Fork 0

Linting for E1101

Pylint throws 2 false positives for E1101 under Python2 (but runs cleanly in Python3). Disabling these.

Signed-off-by: Corey Shields <cshields@gmail.com>
merge-requests/402/head
Corey Shields 2019-07-27 14:29:24 -04:00
parent f9336eb0b4
commit 9359532df9
3 changed files with 4 additions and 3 deletions

View File

@ -6,6 +6,5 @@ ignored-argument-names=args|kwargs
[MESSAGES CONTROL]
disable=
C0412,
E1101,
R0801, # needs to remain disabled see https://github.com/PyCQA/pylint/issues/214
W0511,

View File

@ -114,7 +114,8 @@ class Satellite(models.Model):
:returns: the valid transmitters for this Satellite
"""
return Transmitter.objects.filter(satellite=self.id).exclude(status='invalid')
# Remove the following pylint disable after Python 3 migration
return Transmitter.objects.filter(satellite=self.id).exclude(status='invalid') # pylint: disable=E1101
# TODO: rename this to sound more like a count
@property

View File

@ -61,7 +61,8 @@ def calculate_transmitters_stats():
transmitters in db (such as total and percentage of alive)"""
transmitters = Transmitter.objects.all()
total_transmitters = transmitters.count()
alive_transmitters = transmitters.filter(status='active').count()
# Remove the following pylint disable after Python 3 migration
alive_transmitters = transmitters.filter(status='active').count() # pylint: disable=E1101
if alive_transmitters > 0 and total_transmitters > 0:
try:
alive_transmitters_percentage = '{0}%'.format(