|
Add a setting for mapping file extensions to syntax highlighters for
diffs
Adds a default mapping of file extensions to pygments lexers, which
administrators may modify to define their own custom mapping. If a
mapping is not defined for a certain file extension, we revert to
the old behaviour of guessing which lexer to use given the filename
and file contents.
|
810c268b04d766208982bd9cc5772fb472ab2e50 |
Michelle |
|
Uses for else clause and .items() instead of .keys() for searching the
mapping
|
a5a683ce294e75b13c7c4b600ab1c6b7a2d9416d |
Michelle |
|
Logs an error if a mapped lexer does not exist in Pygments
|
6da489bde81ca3eb9df84c3bb4e79425b18b7e45 |
Michelle |
|
Removed trailing whitespace
|
8e396cb6f373d3336d411804d2973bb2f06680be |
Michelle |
|
Properly imports mapping from settings.py
|
23ec2199b6b867851f9d8d8163a85e9ba9898bce |
Michelle |
|
fixed string formatting for logged error
|
5785f25b427e1b18316db43ddcc98e02ba646892 |
Michelle |
|
Made CUSTOM_PYGMENTS_LEXERS a class attribute (this makes it easier
to modify during testing)
|
eefc9d52856d30d61963a6d34ebc76102b33bf2b |
Michelle |
|
took out print statement from testing
|
967ef3e281d39d468ef4d9c9f360f6a1e28087ec |
Michelle |
|
Added unit tests for apply_pygment, testing that default
custom mapping works and that mapping to a non existant class
logs an error
|
33139db632f2c36deb14cc9a493c4f33cb6754fe |
Michelle |
|
Modified doc formatting and changed default test to instead
test if using a custom mapping overrides the guessing
function to determine a lexer
|
224a9d9c751d4525937d3b4cae2f85a5f09d2e6a |
Michelle |
|
fixed flake8 issues
|
e6eed2477b86a382140fbe0d215819ea4a17c8a9 |
Michelle |
|
fixed one last flake8 indent issue
|
9b1f2c9a68e2161a9d67cb1064ec09063e8aeb50 |
Michelle |
|
better logging message, fixed formatting issues, removed mapping attribute an...
|
211c72f95930609b6655ad0f06f229df884d2d62 |
Michelle |
|
fixed a couple flake8 issues
|
ad32f6009c25e8d555c19622857422236ee46f5f |
Michelle |
|
moved mapping to siteconfig instead of settings.py
|
d7549e8107b35ceae203e9099b2a323bd7e89042 |
Michelle |
|
initial form for mapping in diff viewer settings
|
09b9854b63f1c67e6684c300b7c9fd971a65d175 |
Michelle |
|
added test for empty mapping
|
a36c2ee69209caa2053c1ea80431762a97cf9379 |
Michelle |
|
create LexersMappingWidget and using in diff_settings.py for now to test
|
dfdc4468076bf6d899533efc6fb3c4b9f1088394 |
Michelle |
|
create tests for lexers mapping widget
|
2d37e23bb79913a72a2e2c580d2023e73d7449c7 |
Michelle |
|
testing listeditwidget with custom pygments lexers setting
|
38a50c83e212b487d4d62537b0fa64c9c6cbe2ff |
Michelle |
|
add documentation and finalize code
|
8d4a6d7996c73bee56335d8f5ea55f16d4aee271 |
Michelle |
|
no need for local site tests
|
19678b279aef9280842c45bebbf420098da9c9be |
Michelle |
|
skip extension if its empty string since it would match any file
|
43a4b9f467132947149f2eb315abbcbd3cccbdb7 |
Michelle |
|
fix some flake8 issues
|
df5ee812136e0eb9a94c4358a3288e26401d06fc |
Michelle |
|
address review feedback
|
70eabb4e4983c7d39c06520389aaabde45d88b76 |
Michelle |
|
address feedback
|
83df1297d190d6aa433b6a07e3acea09e499762f |
Michelle |