28 Commits

Author SHA1 Message Date
Feanil Patel
49158e742c build: Move the pylint_django_settings plugin.
When it was located at the root of the project, it was sometimes not
getting loaded correctly since the root of the project is not a python
module, and producing the following error:

```
Command line or configuration file:1:0: E0013: Plugin 'pylint_django_settings' is impossible to load, is it installed ? ('No module named 'pylint_django_settings'') (bad-plugin-value)
```

This led all the pylint tests to fail.

This started happening more as we updated other dependencies via make
upgrade for some reason and led to inconsistent builds.  The move should
hopefully make the loading reliable and consistent.
2025-06-02 14:02:25 -04:00
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
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
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
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
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
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
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
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
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
ff2bb10325 Use 'edx_lint write' to create our pylintrc from pylintrc_tweaks 2015-03-03 17:09:19 -05:00