summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* all: convert "re" to "regex"regexGeorg Brandl2022-10-274-4/+7
|
* Add World of Warcraft TOC file lexer (#2244)Tim Martin2022-09-211-1/+4
| | | Also fix a broken link and decode as UTF8 in count_token_references.py.
* gen_mapfiles.py: convert Path to str before adding to sys.path (#2223)Jean Abou-Samra2022-09-011-1/+1
| | | | pathlib.Path entries in sys.path are actually ignored. See https://github.com/python/cpython/issues/96482
* Merge mapping file generation scripts (#2152)Jean Abou-Samra2022-05-291-0/+53
| | | | | | | | | Use a unified script, to reduce code duplication and in preparation for doing a similar thing with styles and filters. The new script also uses a bit more modern Python APIs (e.g., pathlib). Unlike the previous scripts, it does not replace replace CRLF with LF because Git should do that itself.
* Add more CSS property names (fixes #2113).Matthäus G. Chajdas2022-04-241-0/+33
| | | | | This change also adds a script to regenerate the list of CSS properties from the W3C source if needed.
* Remove now redundant re.UNICODE and (?u) (#2058)Jean Abou-Samra2022-01-311-2/+2
|
* Add a "plugins" argument to get_all_lexersGeorg Brandl2022-01-251-8/+6
| | | | and use it in the "duplicate filenames" checker.
* Happy new year.Georg Brandl2022-01-257-8/+8
|
* Fix typos (#2030)Kian-Meng Ang2022-01-184-13/+13
|
* Update release-checklist.Matthäus G. Chajdas2021-12-301-1/+1
| | | | Use -m build instead of setup.py.
* Handle ' and " in the repeated token script.Matthäus G. Chajdas2021-11-131-2/+4
|
* Formatting fixes only.Matthäus G. Chajdas2021-11-061-1/+1
|
* Add a script to check for repeated tokens.Matthäus G. Chajdas2021-11-061-0/+103
|
* Prohibit contrast degradation for styles via test (#1919)Martin Fischer2021-11-011-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Web accessibility is important. Unfortunately currently many pygments styles have rules with poor contrasts. This commit introduces a test case that fails if the minimum contrast of a style gets worse, e.g: E AssertionError: contrast degradation for style 'borland' E The following rules have a contrast lower than the required 2.9: E E * 1.90 Token.Text.Whitespace E * 2.80 Token.Generic.Heading E * 2.30 Token.Generic.Subheading E E assert not 1.9 < 2.9 This is accomplished by storing the current minimum contrasts in ./tests/contrast/min_contrasts.json. When you improve a minimum contrast the test fails with: E AssertionError: congrats, you improved a contrast! please run ./scripts/update_contrasts.py E assert not 1.9 > 0.9 Running the script as instructed updates the JSON file, making the test pass. New styles are required to meet the WCAG AA contrast minimum of 4.5. First commit to address #1718.
* Improve checks. (#1884)Matthäus G. Chajdas2021-08-173-7/+13
| | | | | | | | | Improve checks. * Fix lots of small errors. * Remove the line length check. * Add an option to skip lexers with no alias * Run checks in make check * Add a new CI target.
* Remove unicorn token types (fixes #1816.)Matthäus G. Chajdas2021-06-201-0/+0
| | | | | | The PR #1819 provides a tool to identify unique token types. This PR aims to remove the most obvious cases of unicorn styles which are used in a single lexer only.
* Add scripts/count_token_references.py to check for "unicorn" tokens. (#1819)Walter Dörwald2021-06-201-0/+267
|
* TNT: fix reliance on "assert" stmt, handle recursionGeorg Brandl2021-05-301-3/+4
|
* scripts: fix file headersGeorg Brandl2021-01-212-1/+11
|
* remove unused epydoc css fileGeorg Brandl2021-01-211-280/+0
|
* fix check_sources: we dont have an encoding decl anymoreGeorg Brandl2021-01-201-21/+14
| | | | and a few other things
* Also add auto-updatable output-based tests to examplefiles (#1689)Oleh Prypin2021-01-201-2/+0
| | | Co-authored-by: Georg Brandl <georg@python.org>
* Run pyupgrade across codebase to modernize syntax and patterns (#1622)Jon Dufresne2021-01-174-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | pyupgrade is a tool to automatically upgrade syntax for newer versions of the Python language. The project has been Python 3 only since 35544e2fc6eed0ce4a27ec7285aac71ff0ddc473, allowing for several cleanups: - Remove unnecessary "-*- coding: utf-8 -*-" cookie. Python 3 reads all source files as utf-8 by default. - Replace IOError/EnvironmentError with OSError. Python 3 unified these exceptions. The old names are aliases only. - Use the Python 3 shorter super() syntax. - Remove "utf8" argument form encode/decode. In Python 3, this value is the default. - Remove "r" from open() calls. In Python 3, this value is the default. - Remove u prefix from Unicode strings. In Python 3, all strings are Unicode. - Replace io.open() with builtin open(). In Python 3, these functions are functionally equivalent. Co-authored-by: Matthäus G. Chajdas <Anteru@users.noreply.github.com>
* debug_lexer: add Atheris fuzzer mode (for Google OSS-Fuzz)Georg Brandl2021-01-171-11/+50
|
* Bump copyright year.Matthäus G. Chajdas2021-01-034-5/+5
|
* debug_lexer: add an option to utf8-decode input with "ignore" handler ↵Georg Brandl2020-12-251-4/+14
| | | | (useful for fuzzer testcases)
* scripts/debug_lexer: allow guessing from contentGeorg Brandl2020-12-191-8/+23
|
* Add a check for CR/LF in files. (#1547)Matthäus G. Chajdas2020-09-201-0/+33
| | | | | | | | | | | | | | | | | | | * Add a check for CR/LF in files. This can occur when checking out things on Windows, and it breaks the tarball. This adds a script to check for the presence of CR/LF which exits early if anything gets found. * Improve error checking. * Include the external folder and check that. * Include .bashcomp files. * Use the correct CR/LF on the checker itself. * Address review feedback. * Remove || true * Fix docs * Print the first offending file name
* Remove symlink.Matthäus G. Chajdas2020-09-191-1/+0
| | | | | Windows doesn't support symlinks out of the box, and there doesn't seem to be any use of this symlink, so let's remove it.
* all: remove "u" string prefix (#1536)Georg Brandl2020-09-082-2/+2
| | | | | | | | | | | * all: remove "u" string prefix * util: remove unirange Since Python 3.3, all builds are wide unicode compatible. * unistring: remove support for narrow-unicode builds which stopped being relevant with Python 3.3
* all: use yield from (#1537)Georg Brandl2020-09-061-4/+2
|
* Update copyright year (fixes #1514.)Matthäus G. Chajdas2020-08-223-4/+4
|
* Add more checks to the release checklist.Matthäus G. Chajdas2020-03-081-2/+4
|
* Remove Python2 release instructions.Matthäus G. Chajdas2020-03-081-1/+0
|
* Remove Python 2 compatibility (#1348)Georg Brandl2020-02-295-10/+1
| | | | | | | | | | | * Remove Python 2 compatibility * remove 2/3 shims in pygments.util * update setup.py metadata * Remove unneeded object inheritance. * Remove unneeded future imports.
* add github release stepGeorg Brandl2019-11-291-1/+2
|
* keep version number in one place, dont do the "x.y.z+" anymoreGeorg Brandl2019-11-291-2/+2
|
* Post-release updates; also tweak checklistGeorg Brandl2019-11-291-5/+3
|
* check_sources: handle empty .py filesGeorg Brandl2019-11-291-0/+3
|
* Update hg/bitbucket -> git/github everywhere.Georg Brandl2019-11-101-5/+5
|
* Fixup all headers and some more minor problems.2.4.2Georg Brandl2019-05-283-4/+4
|
* Fix ResourceWarning: unclosed fileMicka?l Schoentgen2019-01-071-1/+2
| | | | Also uniformize usage of the 'with' contact manager to prevent resource leaks.
* Minimal fixup changes for the release, add release date.2.3.0Georg Brandl2018-11-251-16/+16
|
* add release checklistGeorg Brandl2018-11-241-0/+24
|
* Copyright update.Georg Brandl2017-01-223-4/+4
|
* Add support for partials and path segments for Handlebars.Christian Hammond2016-11-048-0/+2081
This introduces support for some missing features to the Handlebars lexer: Partials and path segments. Partials mostly appeared to work before, but the `>` in `{{> ... }}` would appear as a syntax error, as could other components of the partial. This change introduces support for: * Standard partials: `{{> partialName}}` * Partials with parameters: `{{> partialName varname="value"}}` * Ddynamic partials: `{{> (partialFunc)}}` * Ddynamic partials with lookups: `{{> (lookup ../path "partialName")}}` * Partial blocks: `{{> @partial-block}}` * Inline partials: `{{#*inline}}..{{/inline}}` It also introduces support for path segments, which can reference content in the current context or in a parent context. For instance, `this.name`, `this/name`, `./name`, `../name`, `this/name`, etc. These are all now tracked as variables.