Commit Graph

55 Commits

Author SHA1 Message Date
Muhammad Soban Javed
a361cbdbe9 Added a pylint plugin to set django settings module (#26938)
* Added a pylint plugin to set django settings module according to the module on which pylint is ran

* Fix quality

Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com>
2021-03-16 12:53:02 +05:00
usamasadiq
149c218a8c disable logging-format-interpolation warning 2021-02-09 16:01:52 +05:00
Matt Tuchfarber
978183bfc6 Update to newest edx-lint
Copy existing pylintrc changes to pylintrc_tweaks
2021-02-08 12:26:47 -05:00
usamasadiq
1175838fa5 fix pep8 warnings 2021-02-08 16:08:01 +05:00
usamasadiq
193a4b409d disable useless-suppression warning 2021-01-27 14:17:21 +05:00
Kyle McCormick
390d1b2d5c Fix linting as it relates to import_shims, and vice versa (#25632)
* Fix import_shims pylint violations; lint import_shims
* Do not shim imports when running pylint
* Regenerate import_shims
2020-11-24 09:36:15 -05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Kyle McCormick
090e10683c Rename sys_path_hacks/ to import_shims/
The old folder name is somewhat confusing, because the
folder contains shims to _compensate for the removal
of sys.path hacks_, but does not contain the sys.path
hacks themselves.

Furthermore, this import_shims/ system could also be
used for other import path changes, such as turning
the locally-installed packages in common/lib/
into regular, importable modules
(e.g. `from common.lib.xmodule import abc` instead of
`from xmodule import abc`). So, a name that is not
specific to the sys.path hacks may be better
in the medium-to-long term.

Along the same lines, we also rename SysPathHackWarning
to DeprecatedEdxPlatformImportWarning.
2020-10-30 10:20:48 -04:00
Kyle McCormick
4847a18a66 Remove sys.path modification for Studio; use sys_path_hacks instead
Also, tweak the un_sys_path.sh script.
2020-10-19 09:34:31 -04:00
Kyle McCormick
8b52ccd659 Update pylintrc to use sys_path_hacks/ for LMS (#25164) 2020-09-30 16:48:31 -04:00
Kyle McCormick
329a1147e3 Run 'edx_lint write pylintrc' (#25165) 2020-09-30 15:32:54 -04:00
Jeremy Bowman
45644a3511 Upgrade edx-lint BOM-1298 (#23227)
The last time we tried this upgrade we encountered timeouts on the quality job, which it now appears were due to the worker running pylint common running out of memory and killing the Jenkins process. Switching to a different worker type with double the RAM (8 GB vs. 4 GB) seems to have fixed this; about 5.5 GB was used. Upstream is aware of the high memory usage on large projects, it's apparently due primarily to a cache of parsed modules: https://github.com/PyCQA/pylint/issues/1495 .

Even after disabling some of the new checks that have been added, the new version of pylint found about twice as much to complain about. Just bumping the threshold for now to unblock the Django upgrade, we can try automated utilities like pyupgrade to fix some of these later.
2020-03-02 08:27:19 -05:00
Jeremy Bowman
0cb7539999 Python dependencies cleanup (#22612) 2019-12-27 11:00:46 -05:00
Michael Youngstrom
c5f04c60b4 Update edx-lint to 1.3.0 (#20750) 2019-06-05 14:17:59 -04:00
Robert Raposa
e3322da058 fix disable of pylint ungrouped-imports
See https://github.com/edx/edx-platform/pull/20644 for original
attempt at disabling, and more info about why.
2019-05-23 13:44:14 -04:00
Robert Raposa
52266726b3 remove ungrouped-imports rule from pylint 2019-05-18 22:02:09 -04:00
Ned Batchelder
cb14e6b789 edx_lint write pylintrc 2019-04-10 19:12:29 -04:00
Troy Sankey
35f6822f92 PII annotations can be longer than 120 characters now
PLAT-2424
2019-02-21 15:39:12 -05:00
Matthew Piatetsky
5b1007cda2 enable unicode format string linter 2019-02-20 14:39:06 -05:00
Calen Pennington
95252f1a81 Run caniusepython3.pylint_checker 2019-02-01 10:03:42 -05:00
Ned Batchelder
0a0219d9dc New edx-lint has unicode-format-string, disable it for now. 2018-12-17 15:09:46 -05:00
Calen Pennington
6d8ce9bcd2 Move pylint sys.path hackery into pylintrc so that any use of pylint gets it 2017-12-01 14:34:49 -05:00
Calen Pennington
898dd6be49 Use the latest version of edx-lint 2017-12-01 14:34:48 -05:00
Jeremy Bowman
0f51a397cb Exclude .tox directory from quality checks 2017-10-26 13:48:22 -04:00
Andy Armstrong
4839bf4c21 Ignore node_modules when checking Python quality 2016-01-27 13:41:27 -05:00
Robert Raposa
424d26c972 Update pylintrc_tweaks
Add changes for longer names.  This will get backed out once it
makes it in to edx-pylint.

TNL-3425
2015-12-22 11:43:49 -05:00
Ned Batchelder
756941524c Update to latest edx-lint 2015-12-18 20:56:07 -05:00
Ned Batchelder
1f093eccfb Use 0.3.2 of edx-lint, with pylint-django and C extensions read 2015-11-03 16:22:40 -05:00
Ned Batchelder
1775076500 Update edx-lint to get updated pylintrc for Meta
It's silly to have to shut up pylint for "class Meta" all the time.
2015-10-21 07:34:15 -04:00
Ned Batchelder
f47a53eb66 Update edx-lint to 0.2.6
This gets us checking for tests inheriting from other tests.  When that
happens, tests get run more than once, which is pointless.  We have a
few dozen new warnings due to this new check.

This also disables unused-wildcard-import.  That removes a few hundred
warnings.

Together, this means we can reduce the pylint limit to 5999. :)
2015-09-03 18:22:21 -04:00
Ned Batchelder
5b6294fe23 Update edx_lint to latest, with range checker 2015-06-02 09:47:12 -04:00
Ned Batchelder
ff2bb10325 Use 'edx_lint write' to create our pylintrc from pylintrc_tweaks 2015-03-03 17:09:19 -05:00
Calen Pennington
b93b541733 Add our custom pylint plugin
So far, it checks:

* Whether setUp is called in TestCase setUp methods.
* If _("translate me") functions are called with only string literals.
2015-02-06 11:58:37 -05:00
Jesse Zoldak
1042e47e3c Revert "Add pylint plugin to check whether setUp is called in TestCase setUp methods."
This reverts commit a92ca9d79a.
2015-02-05 12:45:47 -05:00
Calen Pennington
a92ca9d79a Add pylint plugin to check whether setUp is called in TestCase setUp methods. 2015-02-04 09:09:14 -05:00
Jesse Zoldak
fdb586786e Disable pylint R0801 duplicate-code checker 2015-01-12 17:02:12 -05:00
David Baumgold
d6b187d147 Update pylint to 1.4.0 2015-01-08 16:24:44 -05:00
Calen Pennington
d919d2ae46 Teach LMS how to render XBlockAsides
[PLAT-217]
2014-12-13 08:26:28 -05:00
Christine Lytwynec
25d76da4ef add disable fixme to pylintrc 2014-12-08 09:19:19 -05:00
Ben Patterson
22fb193b36 Enforce pylint violation when using old event tracker. 2014-11-26 16:50:15 -05:00
John Cox
8ecfa8679a Add common/djangoapps/third_party_auth; update pylintrc to allow test_* names.
third_party_auth contains a working settings mechanism, the start of the provider interface + 3 implementations (Google, Mozilla Persona, LinkedIn), and a stub for the auth pipeline. Modified existing lms settings files to use but deactivate the module.
2014-03-06 17:20:58 -08:00
Calen Pennington
64008200f3 Fix pylint violations 2014-02-10 13:34:25 -05:00
Calen Pennington
79e1dae0e7 Fix pylint violations from #2129 2014-01-15 11:05:56 -05:00
David Baumgold
ff5baa7ace pylint: db is a valid variable name 2013-10-28 14:31:23 -04:00
Calen Pennington
f500b72290 Make sure that we have the right set of fields available during xml parsing
We had a bug where mixins weren't being applied before `load_from_xml`
was called. This meant that not all of the fields were being loaded
correctly. To fix it, we used the mixoligist from the runtime to apply
the mixins earlier in the process. However, that caused the mixins to be
applied twice.

The included fixes to xblock resolved the multiply-applied mixins, and
the fixes to the parsing code make it simpler to understand, and add
some unit tests of the parsing to boot.
2013-09-27 10:57:39 -04:00
Jay Zoldak
c8949b99d1 Disable pylint violation E0611 when importing assert_* methods from nose.tools
Cleaned up files with muliline imports

Cleaned up files that do not use these imports

Misread comment
2013-08-27 16:21:33 -04:00
Jay Zoldak
36a68a18f2 Change pylint settings to not report in importing assert_* from nose.tools 2013-08-19 14:26:34 -04:00
David Baumgold
248793c127 Fix some pylint issues 2013-07-31 15:42:11 -04:00
Sarina Canelake
ff4888cbc5 Ignore Pylint R0921 2013-07-08 08:03:13 -04:00
Ned Batchelder
2057436e70 Make some tweaks to the pylintrc
No one reads the pylint reports, we just want the messages.
setUp and tearDown don't need docstrings.
More ways to mark arguments as unused.

More tweaks
2013-07-03 11:05:11 -04:00