Commit Graph

70 Commits

Author SHA1 Message Date
Usama Sadiq
1a16073ad0 fix: enable pylint warnings (#36196) 2025-02-03 14:18:11 +05:00
Usama Sadiq
b6828cecaa fix: enable pylint warnings (#36195)
* fix: enable pylint warnings
2025-01-30 17:15:33 +05:00
Usama Sadiq
2d7a3d3fbd fix: remove pylint constraint (#36169) 2025-01-27 21:25:42 +05:00
Muhammad Farhan
a99e915c2e fix: Fix pylint_django_settings plugin (#35497) 2024-10-16 21:32:50 +05:00
Usama Sadiq
4734f9f16e fix: bump pylint version (#31084) 2022-10-27 12:19:09 +05:00
UsamaSadiq
897cb3617f refactor!: delete common/lib and related usages 2022-09-22 14:16:34 +05:00
Sarina Canelake
6b42d67513 chore: run Manage local config files from masters in edx_lint.
version 5.3.0
Commands:

    write FILENAME
        Write a local copy of FILENAME using FILENAME_tweaks for local tweaks.

    check [FILENAME ...]
        Check that FILENAME has not been edited since writing.
        If FILENAME is omitted, all existing files are checked.

    list
        List the files that edx_lint can provide.

    update
        Re-write any edx_lint-written files that exists on disk.
     update with the current version of the repo.
2022-09-15 17:13:49 -04:00
Jawayria
7f5b4a6a47 chore: removed 'wrong-import-order' from disabled imports (#29365)
* chore: removed 'wrong-import-order' from disabled imports
2022-01-06 19:14:51 +05:00
Usama Sadiq
95427251dc fix: fixed pylint warnings 2021-10-21 09:54:22 -04:00
Usama Sadiq
9ee8df0980 fix: Remove pylint constraint and fix warnings (#28646) 2021-10-20 23:00:13 +05:00
Usama Sadiq
746a33fee2 fix: update pylintrc with edx-lint==5.2.0 (#28863) 2021-09-28 17:32:19 +05:00
Usama Sadiq
1795008686 fix: Removed pylint constraint (#28222)
Disabled pylint warnings in pylint_tweaks
2021-07-23 18:35:57 +05:00
Usama Sadiq
e25f00f35c fix: Removed unnecessary constraints (#27915)
Updated constraints of following packages:
inflect,geoip2,maxmindb,path,isort (isort>5.0.0 introduced wrong-import-order warnings so disabled the warning)
2021-07-07 13:56:18 +05:00
Aarif
58a54f8d0b BOM-2543: Remove the diff-quality step from quality checks (#27619)
* build: Removed the diff-quality step
Applied lint-amnesty on all the warnings
Removed pylint thresholds comparison code and related tests

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
2021-06-07 18:37:06 +05:00
Awais Qureshi
2be5184e38 BOM-2340
Testing pylint-pytest package
2021-04-14 17:40:18 +05:00
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