1
0
Fork 0
Commit Graph

33 Commits (master)

Author SHA1 Message Date
Vasilis Tsiligiannis fc90760e7c pylint: Remove W0603 warning on 'args' and 'kwargs', remove unused Python 2 configuration
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-09-02 01:49:51 +03:00
Corey Shields 6920bbab03 move py2 lint exceptions to .pylintrc
Ignore py2-specific linting errors in .pylintrc while testing them in .pylintrc3

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-08-10 15:53:00 -04:00
Corey Shields f1420d3e9e Linting W0511
part of W0511

Filed #321 and moved code comments to #265

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 15:38:02 -04:00
Corey Shields fc8f9a8c35 Linting for C0412
There are clashes between the positioning and ordering of our imports between pylint and isort, just ignoring them on the pylint side for now..

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 14:45:19 -04:00
Corey Shields 9359532df9 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>
2019-07-27 14:29:24 -04:00
Corey Shields f9336eb0b4 Linting for R0401
Fixes a cyclical dependency between calling the celery app through an import in tasks.py (which then imports tasks.py) by retrieving celery through the class.

Tested in local dev

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 14:17:16 -04:00
Corey Shields b0bfe0eea7 Keep R0801 disabled
R0801 trips on our norad argument handling in fetch_satellites.py and delete_satellite.py - but there is no way to disable it locally due to a bug.  See https://github.com/PyCQA/pylint/issues/214

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 12:41:29 -04:00
Corey Shields 8271351729 Linting for R0901
Ignoring cases of too many ancestors in API views.py as these are upstream, not much we can do about it.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 12:22:41 -04:00
Corey Shields 91d8ba20bd Linting for R0903
Ignoring R0903 for tests.py where we do not need to care about public methods, and for django managers in models.py

This negates the need for MR !396

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 12:13:56 -04:00
Corey Shields b704454486 Linting for R0914
A couple of functions in tasks and utils were refactored with new helper functions to reduce the number of local variables per function.

In addition, fetch_data.py was flagged with R0914 but this is a relic of the original attempt at decoding data into DB, and is unused - so I am removing rather than fixing it.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 12:10:47 -04:00
Vasilis Tsiligiannis 70ffe07f22 Reduce number of statements, resolve pylint 'R0915'
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-17 17:52:35 +03:00
Vasilis Tsiligiannis 5abb3553f9 Do not call return in 'if' and 'else'
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-17 17:52:10 +03:00
Vasilis Tsiligiannis 26662074e5 isort: Declare 'factory' as a third-party import
* Apply changes based on new configuration
* Enable 'C0411' pylint checking

Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-17 17:51:53 +03:00
Vasilis Tsiligiannis 3404db012c Move form validation function out of class, fix 'E0213' pylint error
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-17 17:51:48 +03:00
Corey Shields 9989efb453 linting for R0201
Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 19:12:54 -04:00
Corey Shields 3ce647e374 linting R0101
too-many-nested-blocks - pulled a break point out for utils.py/decode_data to get rid of a nested block

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 18:49:18 -04:00
Corey Shields 389194b076 linting W5104
using field excludes is an antipattern and a possible security risk down the road. Replaced with explicit fields list.
2019-07-13 18:42:11 -04:00
Corey Shields c376e08826 linting W5102, W5103
Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 18:33:03 -04:00
Corey Shields adfc08bb79 linting W1201, W1202
fix logging strings to %s format

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 18:15:13 -04:00
Corey Shields 6bc64e9217 linting for W0703
broad-except, I added explicit exceptions where I felt safe doing so - but we do have a lot of broad exceptions accepted.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 18:08:55 -04:00
Corey Shields fe1f989d7b linting for W0621
resolving name conflicts between variables and functions

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 17:38:04 -04:00
Corey Shields 0d4701b100 linting W0612, W0613
Mostly disabling the alerts on django signals and filter attributes that go unused.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 16:24:43 -04:00
Corey Shields fca0c1d419 Linting W0223
We were missing a call to return the login page from a BaseAuth abstract function.

Once this is in dev (an auth0 environment) I suspect it might fix librespacefoundation/satnogs/satnogs-db#309

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 15:40:28 -04:00
Corey Shields 678de105dd linting W0201 and W0221
we are going to ignore W0201 and W0221 around the TransmitterEntry save function. Reasons are in the code comments.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 15:32:04 -04:00
Corey Shields ec07c59263 linting for W0150
the check_celery function returns in a finally, which is unnecessary and is an antipattern. This works just the same dropping the finally statement and returning in the end.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 14:46:16 -04:00
Corey Shields a8a0dc4aa6 linting W0107
check_celery had an invalid pass, replaced that with a log entry.
 
Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 14:38:20 -04:00
Corey Shields 8b6410ba2c W0105 linting - remove display_decoded
display_decoded is an unused relic of the original decode method, and throws a W0105 warning.

removing this function completely

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 14:28:04 -04:00
Corey Shields 2ec2fd2a4d pylint C0111 docstrings
phew, fixed all of the missing-docstring and found some other things along the way (for future changes)
2019-07-12 22:36:18 -04:00
Corey Shields a697548a56 pylint C0122
Linting for misplaced-comparison-constant

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-12 17:47:28 -04:00
Pierros Papadeas 8a51d27f65 Fix C0325 pylint error
Signed-off-by: Pierros Papadeas <pierros@papadeas.gr>
2019-07-12 19:57:27 +00:00
Corey Shields b7ec119853 pylint C0103
Linting for Pylint C0103

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-12 12:41:21 +00:00
Pierros Papadeas 853381a5dc
Fix pylint C1801 errors
Signed-off-by: Pierros Papadeas <pierros@papadeas.gr>
2019-07-12 09:48:33 +03:00
Vasilis Tsiligiannis 3872105dac Introduce 'pylint' for static code analysis (fixes #289)
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-02 16:38:18 +03:00