46 Commits

Author SHA1 Message Date
Irtaza Akram
99c6e901d9 Convert Problem Block Mako Templates to Django Templates (#37570)
* fix: convert mako to django templates for problem block

* fix: pylint issues
2025-12-09 19:29:06 +05:00
Feanil Patel
28ab2ceb67 fix: Drop other references to studiofrontend.
Drop tooling to load studio-frontend components into mako templates and
XSS testing features related to it.
2025-10-20 14:08:45 -04:00
sarina
1e3074a3f9 docs: Update edx.rtd.io links to docs.openedx.org 2025-04-02 12:10:56 -04:00
salmannawaz
1573c7b07f build: replace paver quality tests and js commands (#35159) 2024-12-11 19:15:17 +05:00
Syed Ali Abbas Zaidi
8480dbc228 chore: apply amnesty on existing not fixable issues (#32215)
* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint line around directives issue

* fix: eslint semi rule

* fix: eslint newline per chain rule

* fix: eslint space infix ops rule

* fix: eslint space-in-parens issue

* fix: eslint space before function paren issue

* fix: eslint space before blocks issue

* fix: eslint arrow body style issue

* fix: eslint dot-location issue

* fix: eslint quotes issue

* fix: eslint quote props issue

* fix: eslint operator assignment issue

* fix: eslint new line after import issue

* fix: indent issues

* fix: operator assignment issue

* fix: all autofixable eslint issues

* fix: all react related fixable issues

* fix: autofixable eslint issues

* chore: remove all template literals

* fix: remaining autofixable issues

* chore: apply amnesty on all existing issues

* fix: failing xss-lint issues

* refactor: apply amnesty on remaining issues

* refactor: apply amnesty on new issues

* fix: remove file level suppressions

* refactor: apply amnesty on new issues
2023-08-07 19:13:19 +05:00
Syed Ali Abbas Zaidi
adf879e8b2 Revert "fix: all auto fixable eslint issues (#31900)" (#32203)
This reverts commit 228180b1ef.
2023-05-09 13:53:54 +05:00
Syed Ali Abbas Zaidi
228180b1ef fix: all auto fixable eslint issues (#31900)
* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint line around directives issue

* fix: eslint prefer template issue

* fix: eslint semi rule

* fix: eslint newline per chain rule

* fix: eslint space infix ops rule

* fix: eslint space-in-parens issue

* fix: eslint space before function paren issue

* fix: eslint space before blocks issue

* fix: eslint arrow body style issue

* fix: eslint dot-location issue

* fix: eslint quotes issue

* fix: eslint quote props issue

* fix: eslint operator assignment issue

* fix: eslint new line after import issue

* fix: indent issues

* fix: operator assignment issue
2023-05-09 11:57:15 +05:00
code-review-doctor
0f24c3b749 fix: some tests are skipped due to duplicate names (#29959)
Co-authored-by: Rebecca Graber <rebecca.s.graber@gmail.com>
2022-04-22 14:31:01 -04:00
Tim McCormack
05704eea39 fix: When xsslint fails with error, list which file it failed on (#29780)
In my case, xsslint was failing with a UnicodeDecodeError -- having this
try/except block helped me discover that it was reading files in my
virtualenv.
2022-01-18 20:24:49 +00:00
Usama Sadiq
a597f1c783 refactor: ran pyupgrade second iteration (#27463) 2021-05-11 15:19:48 +05:00
M. Zulqarnain
2c44315ce0 refactor: pyupgrade on pavelib & scripts (#26769) 2021-03-12 14:14:53 +05:00
Aarif
6af99e64bf replaced unittest assertions pytest assertions (#26270) 2021-02-04 10:08:39 +05:00
Tim McCormack
edeabc3faf Add --summary-format=json option to XSS linter (#25851)
This will simplify updating of the linter thresholds file after XSS linter
violations are addressed.
2020-12-11 12:34:04 +00:00
Samuel Walladge
71fcf6e725 Fix issues with xss linters
Improve accuracy of javascript-escape linter: Previously this would
match on FOOescape() and FOO.escape calls, but neither are the global
escape function we are worried about.

The regex probably isn't 100% accurate; there may be still false
positives (javascript allows a large range of characters in identifiers,
some of which may not be covered by [\w.$]). The main thing is to avoid
false negatives here though - this will definitely catch any use of
`escape()` or `window.escape()`.

Also remove javascript-interpolate lint - this was deemed unecessary.
StringUtils.interpolate is not in fact safe (it does no html escaping),
so the results of this lint are misleading.
2020-05-04 09:27:18 +09:30
Feanil Patel
046feb0cf0 Merge pull request #22649 from edx/feanil/fix_pep8
Fix all E303 pep8 errors.
2019-12-30 13:32:26 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
2df8b8226b Merge pull request #22643 from edx/feanil/2to3_asserts
Run `2to3 -f asserts . -w` on edx-platform.
2019-12-30 12:13:42 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Feanil Patel
70294b0ad2 Run 2to3 -f asserts . -w on edx-platform.
https://docs.python.org/3.5/library/2to3.html#2to3fixer-asserts
2019-12-30 10:22:19 -05:00
asadazam93
7a43721f81 Upgrade python 3 decode error 2019-10-04 16:17:11 +05:00
aarif
66942bc74c python 3 fixes
python 3 fixes

python 3 fixes
2019-09-26 14:19:18 +05:00
Awais Qureshi
8fcb74efa4 BOM-594
Python3 fix.
2019-09-22 04:25:31 +05:00
Awais Qureshi
0dcee53c1c BOM-594
Python3 fix.
2019-09-21 23:42:54 +05:00
Feanil Patel
f59258446f Fix test collection for XSS lint tests.
This was failing before because DDT was trying to get an attribute
from an XSS Lint RuleSet object but that was throwing an exception
because the RuleSet object didn't have that attribute.

In python 2 such exceptions were automatically swallowed by the
getattr function but in python 3 they get raised.
2019-09-05 12:43:17 -04:00
aarif
61800c619f replaced StringIO imports with import from six
replaced cStringIO and StringIO imports with import from six

fixed StringIO imports

fixed StringIO imports

fixed XSS python-wrap warning
2019-08-08 00:09:16 +05:00
Adeel Khan
37c6b60fc8 Adds Django template linter.
This adds Django template linter that
would check for all trans/blocktrans
tag expressions for escaping.

PROD-465
2019-07-25 18:54:03 +05:00
Aarif
a806a7f046 Merge pull request #21042 from edx/INCR-387
INCR-387 Python 3 compatibility
2019-07-18 13:14:10 +05:00
Ayub khan
07f907ec56 INCR-388 python3 compatibility 2019-07-15 13:15:11 +05:00
aarif
0bf108ea8a ran python-modernize and isort on files mentioned in INCR-387 2019-07-10 15:47:38 +05:00
cclauss
bb31716c97 Use ==/!= to compare str, bytes, and int literals 2019-03-19 21:40:06 +01:00
Matt Hughes
2f9819f247 Improve XSS lint for underscore templates
See also
https://edx.readthedocs.io/projects/edx-developer-guide/en/latest/conventions/preventing_xss.html#javascript-edx-namespace

The failure totals in test_main appear to've been wrong previously;
I'm just updating them to run clean via `pytest scripts/xsslint/tests`
2019-02-07 13:54:52 -05:00
Ned Batchelder
2d438d8bb5 Fix 'W605 invalid escape sequence' errors from pycodestyle 2018-11-02 06:06:43 -04:00
Calen Pennington
b4fe3474e7 Fix/ignore errors caused by a pycodestyle upgrade 2018-10-31 12:34:50 -04:00
Jeremy Bowman
713d64e1e2 TE-2702 Update Read the Docs links to HTTPS 2018-08-15 17:34:01 -04:00
Calen Pennington
07a15c681f Reapply the XBlock RequireJS -> Webpack changes
This reverts commit 105db2cf59, reversing
changes made to 447457594f.
2018-06-27 22:27:07 -04:00
Eric Fischer
e72549cdbe Revert "Merge pull request #18340 from cpennington/fix-studio-xblock-rendering"
This reverts commit 9a70ca78a5, reversing
changes made to efd5b9abbd.

Hopefully fixes EDUCATOR-3053
2018-06-15 13:18:27 -04:00
Calen Pennington
1491491d21 Don't treat self-closing tags as context starters 2018-06-13 10:00:13 -04:00
Calen Pennington
be3c7e05c5 Reapply "Switch container factory to webpack"
This reverts commit 18d93b00ba.
2018-06-07 15:52:05 -04:00
Calen Pennington
18d93b00ba Revert "Switch container factory to webpack" 2018-06-07 13:46:47 -04:00
Calen Pennington
0abe75a7c6 Re-apply the changes to convert XBlocks to Webpack
Reapplies edx/edx-platform#17509

This reverts commit 0f7e2373d0.
2018-06-06 12:52:12 -04:00
Calen Pennington
0f7e2373d0 Revert "Switch container factory to webpack" 2018-05-29 16:01:38 -04:00
Calen Pennington
ee6360543b Convert webpackified factories to es6 modules with global exports, and remove the invoke_page_factory pattern 2018-05-29 12:21:46 -04:00
Michael Terry
a34c8c8233 Drop remaining coffee use
This basically commits the transpiled CoffeeScript JS (with minor
cleanup) and removes coffee build support.

A tiny amount of support for xblocks exists, because external users
may have xblocks with coffee. But no coffee in our tree anyway.
2018-04-13 14:10:40 -04:00
Anthony Mangano
edc98939b5 Define XSS-linter rules on Linter classes. 2018-03-23 16:58:27 -04:00
Anthony Mangano
3e7df8688f Add config module for xsslint 2018-03-01 16:52:42 -05:00
Anthony Mangano
07ca440226 Refactor XSS linter into smaller files 2018-03-01 09:46:16 -05:00