Commit Graph

2269 Commits (53fb0baa06a20d908d0d9c1f7dde5a1c925c4be3)
 

Author SHA1 Message Date
Layle | Luca 51c7eb7ac1
Included LLVM syntax highlighting submodule and added regression tests 3 years ago
Keith Hall 5516bcb839
Merge pull request #1779 from sharkdp/http-request-response-syntax-update
Bump assets/syntaxes/02_Extra/http-request-response from f58bffe to 93b9326
3 years ago
Keith Hall 056b966501 Bump assets/syntaxes/02_Extra/http-request-response from f58bffe to 93b9326 3 years ago
Martin Nordholts 28eca6a2be Use assert!(..) instead of assert_eq!(true, ..)
This fixes all of these lint warnings:
https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison

They only appear in recent versions of clippy. Not on our MSRV.
3 years ago
dependabot[bot] b7fd55242e Bump assert_cmd from 1.0.5 to 1.0.8
Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd) from 1.0.5 to 1.0.8.
- [Release notes](https://github.com/assert-rs/assert_cmd/releases)
- [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md)
- [Commits](https://github.com/assert-rs/assert_cmd/compare/v1.0.5...v1.0.8)

---
updated-dependencies:
- dependency-name: assert_cmd
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] 8161955cc7 Bump nix from 0.21.0 to 0.22.0
Bumps [nix](https://github.com/nix-rust/nix) from 0.21.0 to 0.22.0.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/commits)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Keith Hall 3b020fd95a
Merge pull request #1771 from sharkdp/warn_when_missing_contexts
Warn when building assets from files if some referenced contexts are missing
3 years ago
Martin Nordholts 697d106bd4 CICD: Pass --locked to all cargo commands
To avoid that earlier cargo commands "fixes" Cargo.lock before cargo commands
with --locked has a chance to check if it is up to date.
3 years ago
Keith Hall 50e1c6074f Warn when building assets from files if some referenced contexts are missing 3 years ago
Martin Nordholts a610987ef7 assets::tests: Add get_syntax_name() helper
And instead of taking a get_syntax_set() detour to return a
name that represents "no syntax", return such a string directly.
3 years ago
dependabot[bot] a7fd9f4b1b Bump predicates from 1.0.8 to 2.0.1
Bumps [predicates](https://github.com/assert-rs/predicates-rs) from 1.0.8 to 2.0.1.
- [Release notes](https://github.com/assert-rs/predicates-rs/releases)
- [Changelog](https://github.com/assert-rs/predicates-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/assert-rs/predicates-rs/compare/v1.0.8...v2.0.1)

---
updated-dependencies:
- dependency-name: predicates
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] 5f5b77cdda Bump semver from 0.11.0 to 1.0.4
Bumps [semver](https://github.com/dtolnay/semver) from 0.11.0 to 1.0.4.
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/0.11.0...1.0.4)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] 83808a63be Bump serde from 1.0.126 to 1.0.127
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.126 to 1.0.127.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.126...v1.0.127)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Keith Hall 6d5ff671e7 Add HTTP Request/Response syntax as a git submodule 3 years ago
Martin Nordholts ffdf349a96 HighlightingAssets: Encapsulate theme_set behind a getter
Mainly to prepare for potential lazy-loading in the future to
improve startup performance. Like we did for syntax_set.
3 years ago
David Peter f3d53b79a2 Update git2 dependency to fix incompatibility with Rust 1.54 3 years ago
Martin Nordholts 6acec2c074 Reduce startup time in loop-through mode with 80%-90%
Instead of 100 ms - 50 ms, startup takes 10 ms - 5 ms.

HighlightingAssets::get_syntax_set() is never called when e.g. piping the bat
output to a file (see Config::loop_through), so by loading the SyntaxSet only
when needed, we radically improve startup time when it is not needed.
3 years ago
Martin Nordholts 1bac3750df HighlightingAssets: Move out fn get_integrated_*set() to module scope
They are just a way to get access to data embedded in the binary, so they don't
conceptually belong inside HighlightingAssets.

This has the nice side effect of getting HighlightingAssets::from_cache() and
::from_binary(), that are highly related, next to each other.
3 years ago
Martin Nordholts b040efff79 Support a hidden arg --no-custom-assets that skips loading assets from the cache 3 years ago
Martin Nordholts a81009607a HighlightingAssets: Make .syntaxes() and syntax_for_file_name() failable
Or rather, introduce new versions of these methods and deprecate the old ones.

This is preparation to enable robust and user-friendly support for lazy-loading.
With lazy-loading, we don't know if the SyntaxSet is valid until after we try to
use it, so wherever we try to use it, we need to return a Result. See discussion
about panics in #1747.
3 years ago
Martin Nordholts c0e09662b4 HighlightingAssets::get_extension_syntax(): Split up into smaller methods
To make the code easier to understand and change.
3 years ago
Martin Nordholts ccf4563573 Make loading of cached assets closer in performance to integrated assets
Using BufReader makes sense for large files, but assets are never large enough
to require buffering. It is significantly faster to load the file contents in
one go, so let's do that instead.

Closes #1753
3 years ago
David Peter fb1ab09e3e Add Enselic in FUNDING.yml 3 years ago
Sarvesh MD f464b1ba39 Update battest.py
Add decorator test `@classmethod` and fixed spellings.
3 years ago
Frank Steffahn 2ea6348b85 Add `rs` identifier for Rust code blocks in Markdown 3 years ago
David Peter 6e536ab06d Update CHANGELOG 3 years ago
Ville Skyttä 7537e309d8 Add groff syntax
The syntax is named "Man Page" upstream, but our man page syntax is
different, it's for rendered man pages. Rename to Groff and remove
`.man` from extensions.
3 years ago
David Peter 84e2a2e5d1 Add custom FUNDING.yml 3 years ago
Martin Nordholts f6fc826dc6 HighlightingAssets: Introduce private fn new() helper
It already now reduces code duplication slightly, but will become even more
useful in the future when we add more complicated logic such as lazy-loading.
3 years ago
Martin Nordholts 375d55aa5d HighlightingAssets: Encapsulate syntax_set behind a getter
Since we only modify `pub(crate)` items, the stable bat-as-a-library API is not
affected.

This takes us one step closer to making SyntaxSet lazy-loaded, which in turn
takes us one step closer to solving #951.
3 years ago
Martin Nordholts 6ef2bb3283 De-duplicate some themes.bin and syntaxes.bin related code 3 years ago
bl-ue fc0794a83d Fix typo in README 3 years ago
David Peter 589df6792f Add note on vulnerability reporting, closes #1473 3 years ago
David Peter 945bba777b Upgrade CHANGELOG with security vulnerability notice 3 years ago
David Peter 64763eafbe Update Julia syntax test 3 years ago
David Peter 3da4651569 Update Julia syntax, closes #1692 3 years ago
David Peter 311ed2feca Update assets 3 years ago
David Peter 33c11d64f0 Run cargo fmt 3 years ago
David Peter a4b674902f Bump version to v0.18.2 3 years ago
David Peter 3fa09dbe2e Use resolved path for --diagnostic as well 3 years ago
David Peter bf2b2df9c9 Fix for Windows: do not run binaries from CWD
This fixes a bug on Windows where `Command::new` would also run
executables from the current working directory, possibly resulting in
accidental runs of programs called `less`.
3 years ago
dependabot[bot] 3617c98cf5 Bump assets/syntaxes/02_Extra/CMake from `7d6231c` to `ab6ef4e`
Bumps [assets/syntaxes/02_Extra/CMake](https://github.com/zyxar/Sublime-CMakeLists) from `7d6231c` to `ab6ef4e`.
- [Release notes](https://github.com/zyxar/Sublime-CMakeLists/releases)
- [Commits](7d6231c934...ab6ef4ef9f)

---
updated-dependencies:
- dependency-name: assets/syntaxes/02_Extra/CMake
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] 774d36c989 Bump ansi_colours from 1.0.2 to 1.0.4
Bumps [ansi_colours](https://github.com/mina86/ansi_colours) from 1.0.2 to 1.0.4.
- [Release notes](https://github.com/mina86/ansi_colours/releases)
- [Commits](https://github.com/mina86/ansi_colours/commits)

---
updated-dependencies:
- dependency-name: ansi_colours
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] 6abd61865f Bump globset from 0.4.6 to 0.4.8
Bumps [globset](https://github.com/BurntSushi/ripgrep) from 0.4.6 to 0.4.8.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/globset-0.4.6...globset-0.4.8)

---
updated-dependencies:
- dependency-name: globset
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
David Peter 3c59b98dc8 Add CHANGELOG entry for #1687 3 years ago
David Peter 21338ed789 Abort ignored filename suffix stripping early on unworkable filenames 3 years ago
David Peter dc8ab0b5ce Simplify ignored filename suffix stripping 3 years ago
Ville Skyttä ddb39ef2f6 Add syntax tests for ignored filename suffixes 3 years ago
Ville Skyttä 355e62efe9 Find syntax ignoring known backup/template filename suffixes
For example, fall back to `foo.extension` for `foo.extension~`,
`foo.extension.orig`, `foo.extension.in.in` etc.
3 years ago
David Peter fddd11a205 CICD: sync with pastel, minor changes 3 years ago