Commit Graph

15 Commits

Author SHA1 Message Date
Lena 4c85483486 Inline `format!` args wherever possible 2024-02-25 00:38:11 +01:00
David Tolnay 1a54c9bf6d
Eliminate dependency on serde's "derive" feature 2024-02-08 15:55:30 -08:00
David Peter 48541b8507 Fix clippy suggestions
Leads to a performance improvement for `bat -A`:

    | Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
    |:---|---:|---:|---:|---:|
    | `./bat-master --no-config -A ./bat-master` | 259.8 ± 1.1 | 258.4 | 261.7 | 1.15 ± 0.01 |
    | `./bat-2301 --no-config -A ./bat-master` | 225.6 ± 1.8 | 224.0 | 229.5 | 1.00 |
2022-09-04 14:28:44 +02:00
Martin Nordholts 486510395b Allow the license used by GraphQL
This license is apparently common enough that GitHub recognizes it. See
https://github.com/dncrews/GraphQL-SublimeText3/blob/master/LICENSE.

This will fix the CI failure in #2000
2022-02-07 06:14:07 +01:00
Martin Nordholts a3ea798246
Credit syntax definition and theme authors with new `--acknowledgements` option (#1971)
The text that is printed is generated when building assets, by analyzing LICENSE
and NOTICE files that comes with syntaxes and themes.

We take this opportunity to also add a NOTICE file as defined by Apache License 2.0.
2021-12-11 14:00:45 +01:00
Martin Nordholts 7fceb4878f
Load themes lazily for improved startup time (#1969)
This is for #951. Syntax lazy-loading will come later and have a much bigger
impact, but lazy-loading of themes does not have negligible impact.
2021-12-06 09:14:15 +01:00
Martin Nordholts d7671fa8e3 Remove the code related to minimal_syntaxes.bin
To get fast startup, syntect will instead start to lazy-load syntaxes. See
https://github.com/trishume/syntect/pull/393 and discussions in linked PRs.
2021-11-22 20:42:01 +01:00
Bojan Đurđević d6ed5e6746
Support for ignored-suffix CLI arguments (#1892) 2021-11-19 17:05:23 +01:00
Martin Nordholts 9d9b266f54 build_assets.rs: Enable dump of syntax dependencies to Graphviz dot file 2021-09-24 20:07:55 +02:00
Martin Nordholts b9d01c1a61 build_assets.rs: Ignore explicit contexts when tracking dependencies 2021-09-24 20:07:55 +02:00
Martin Nordholts 122cae7902 build_assets.rs: Sort first to make dependencies.dedup() actually useful 2021-09-24 20:07:55 +02:00
Martin Nordholts 5143f3ad43 build_assets.rs: Add code to track dependents of each syntax
This information is useful when you want to build several SyntaxSets, but
without having to duplicate SyntaxDefinitions. For example:

"Rust" has no dependencies. But "Markdown" depends on "Rust". With the data
structures this code adds, we know that "Rust" is a dependent syntax for
"Markdown", and can construct a SyntaxSet that takes that into account.

Note that code has a temporary environment flag to ignore any information about
dependents when constructing SyntaxSets. Code that makes use of the new data
structure will be added later.
2021-09-22 09:14:19 +02:00
Martin Nordholts a6dc25a216 build_assets.rs: Make OtherSyntaxLookup come before SyntaxToDependencies
It makes more sense structurally when we later introduce SyntaxToDependents.
2021-09-22 09:14:19 +02:00
Martin Nordholts f04d2a9d6a build_assets.rs: Rename 'Dependency' to 'OtherSyntax'
So that we later can use it for not only information about dependencies, but
also for information about dependents.
2021-09-22 09:14:19 +02:00
Martin Nordholts e84b702309
Extract some private submodules from 'bat::assets' (#1850) 2021-09-15 07:59:33 +02:00