Commit Graph

2281 Commits (f5a7f86a64eb7aaccf2b6d7e4755a22d6bee4642)
 

Author SHA1 Message Date
Georgy Komarov d04a83de7b Add Racket syntax 3 years ago
invakid404 b622a4d890 chore: add funtoo linux instructions 3 years ago
Roneo.Org b551d28a2f List available Ubuntu packages more precisely.
Ref: https://github.com/sharkdp/bat/pull/1865#issuecomment-931709001
3 years ago
Roneo.Org e6caa04209 Minor rephrasing 3 years ago
Roneo.Org adadedeab1 Update the doc for Ubuntu and Debian 3 years ago
dependabot[bot] a6cf5235aa Bump assert_cmd from 2.0.0 to 2.0.1
Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd) from 2.0.0 to 2.0.1.
- [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/v2.0.0...v2.0.1)

---
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] 1477338106 Bump nix from 0.22.1 to 0.23.0
Bumps [nix](https://github.com/nix-rust/nix) from 0.22.1 to 0.23.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/compare/v0.22.1...v0.23.0)

---
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
Martin Nordholts 418fce5683 Bump MSRV to 1.46
See #1874 and #1872.
3 years ago
dependabot[bot] 7a15ba3796 Bump assets/syntaxes/02_Extra/Julia from `48639e1` to `1e55f32`
Bumps [assets/syntaxes/02_Extra/Julia](https://github.com/JuliaEditorSupport/Julia-sublime) from `48639e1` to `1e55f32`.
- [Release notes](https://github.com/JuliaEditorSupport/Julia-sublime/releases)
- [Commits](48639e1dbf...1e55f3211b)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] 0f002a5b06 Bump serde_yaml from 0.8.20 to 0.8.21
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.20 to 0.8.21.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.20...0.8.21)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] 5344a32d34 Bump unicode-width from 0.1.8 to 0.1.9
Bumps [unicode-width](https://github.com/unicode-rs/unicode-width) from 0.1.8 to 0.1.9.
- [Release notes](https://github.com/unicode-rs/unicode-width/releases)
- [Commits](https://github.com/unicode-rs/unicode-width/compare/v0.1.8...v0.1.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] c9645693a4 Bump flate2 from 1.0.20 to 1.0.22
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.20 to 1.0.22.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.20...1.0.22)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] f607263bdc Bump thiserror from 1.0.28 to 1.0.29
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.28 to 1.0.29.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.28...1.0.29)

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

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

---
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
Kuan-Yi Li 47283f226a Add bash completion to deb package
From the discussion in #1734, instead of using `env.PROJECT_NAME`,
`steps.strip.outputs.BIN_NAME` could potentially be a better choice as
the filename needs to match the called executable for bash-completion's
on demand loading to work. This `BIN_NAME` needs to stay in sync with
`env.PROJECT_EXECUTABLE` which is replaced in the template, but not
available for the deb build at this stage.

Follow the same route as for the fish/zsh completions for now for the
sake of consistency.

Closes #1733
3 years ago
Martin Nordholts aefc8fd824 src/printer.rs: Simplify Plain Text fallback code
By forwarding the task to find the `Plain Text` syntax to `assets`. Not only does
the code become simpler; we also get rid of a call to `self.get_syntax_set()`
which is beneficial to the long term goal of replacing `syntaxes.bin` with
`minimal_syntaxes.bin`.

Note that the use of `.expect()` is not a regression in error handling. It was
previously hidden in `.find_syntax_plain_text()`.
3 years ago
Martin Nordholts 405a80f3ee HighlightingAssets: Turn get_syntax_for_path() into public API 3 years ago
Martin Nordholts ad98d35a48 HighlightingAssets: Implement get_syntax_for_file_name() with get_syntax_for_path()
We can do this since the file_name() of a file_name is file_name.
3 years ago
Martin Nordholts b69ab219d7 HighlightingAssets: Extract get_syntax_for_path() method
To make the code easier to refactor further.
3 years ago
Martin Nordholts dc8225f682 src/assets.rs: Extract helper method OpenedInput::path() 3 years ago
Martin Nordholts 9d9b266f54 build_assets.rs: Enable dump of syntax dependencies to Graphviz dot file 3 years ago
Martin Nordholts b9d01c1a61 build_assets.rs: Ignore explicit contexts when tracking dependencies 3 years ago
Martin Nordholts 122cae7902 build_assets.rs: Sort first to make dependencies.dedup() actually useful 3 years ago
David Peter 44a332c1c4 Parallelize syntax regression tests
The syntax highlighting regression tests can be trivially parallelized.
On my notebook (8 core), this results in a 3.9x speedup.
3 years ago
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.
3 years ago
Martin Nordholts a6dc25a216 build_assets.rs: Make OtherSyntaxLookup come before SyntaxToDependencies
It makes more sense structurally when we later introduce SyntaxToDependents.
3 years ago
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.
3 years ago
Martin Nordholts eb3b3b9f8d src/printer.rs: Add HighlighterFromSet helper
The main benefit is that we get rid of a call to `assets.get_syntax_set()`,
which in turn makes it easier to later get rid of `syntaxes.bin`.
3 years ago
Martin Nordholts 0994f3783f HighlightingAssets: Move common get_extension_syntax() code into find_syntax_by_extension() 3 years ago
Martin Nordholts 974dec38e3 HighlightingAssets: Inline find_syntax_by_file_name() and find_syntax_by_file_name_extension()
There is no benefit to keeping separate functions.
3 years ago
Martin Nordholts a0c363647f src/assets.rs: Use /// not // for COMPRESS_* consts 3 years ago
Martin Nordholts d989224a8a HighlightingAssets: Inline absolute_path
Its name is confusing, because it does not always hold an absolute path. Get rid
of this problem by inlining it.
3 years ago
Martin Nordholts 82f439e715 HighlightingAssets: Simplify absolute_path with .map_or_else() 3 years ago
Martin Nordholts b034879eae HighlightingAssets: No need for both path and path_str 3 years ago
Martin Nordholts 9ed9a6fc3d
Simplify HighlightingAssets::get_syntax() first_line logic (#1852)
And make self.get_first_line_syntax() be called lazily.
3 years ago
Martin Nordholts e84b702309
Extract some private submodules from 'bat::assets' (#1850) 3 years ago
Martin Nordholts 6226eba52a HighlightingAssets: Add find_syntax_by_extension() helper 3 years ago
Martin Nordholts 9e0ea06435 HighlightingAssets: Add find_syntax_by_name() helper 3 years ago
Marcin Puc 863d9cacd0 Add various other code refactorings 3 years ago
Marcin Puc 4baa346aae Use deref coercion to simplify some argument passing 3 years ago
Marcin Puc 7956485e37 Improve iterator usage 3 years ago
Marcin Puc 372e42f350 Reduce nesting in if blocks by short circuiting 3 years ago
Martin Nordholts 9124271eaf
Load independent and minimal syntax sets when using --language (#1787)
This significantly speeds up the startup time of bat, since only a single
linked SyntaxDefinition is loaded for each file. The size increase of the
binary is just ~400 kB.

In order for startup time to be improved, the --language arg must be used, and
it must match one of the following names:

"Plain Text", "ActionScript", "AppleScript", "Batch File", "NAnt Build File",
"C#", "C", "CSS", "D", "Diff", "Erlang", "Go", "Haskell", "JSON", "Java
Properties", "BibTeX", "LaTeX Log", "TeX", "Lisp", "Lua", "MATLAB", "Pascal",
"R", "Regular Expression", "Rust", "SQL", "Scala", "Tcl", "XML", "YAML", "Apache
Conf", "ARM Assembly", "Assembly (x86_64)", "CMakeCache", "Comma Separated
Values", "Cabal", "CoffeeScript", "CpuInfo", "Dart Analysis Output", "Dart",
"Dockerfile", "DotENV", "F#", "Friendly Interactive Shell (fish)", "Fortran
(Fixed Form)", "Fortran (Modern)", "Fortran Namelist", "fstab", "GLSL",
"GraphQL", "Groff/troff", "group", "hosts", "INI", "Jinja2", "jsonnet",
"Kotlin", "Less", "LLVM", "Lean", "MemInfo", "Nim", "Ninja", "Nix", "passwd",
"PowerShell", "Protocol Buffer (TEXT)", "Puppet", "Rego", "resolv", "Robot
Framework", "SML", "Strace", "Stylus", "Solidity", "Vyper", "Swift",
"SystemVerilog", "TOML", "Terraform", "TypeScript", "TypeScriptReact",
"Verilog", "VimL", "Zig", "gnuplot", "log", "requirements.txt", "Highlight
non-printables", "Private Key", "varlink"

Later commits will improve startup time for more code paths.

* fix some typos and misspellings

* CHANGELOG.md: Add Performance section (preliminary)

* Add a CHANGELOG.md entry for this PR
3 years ago
Kevin John Mulligan 156dec2737 Add context to .ino configuration
This allows a user to search the README or the entire repository for "Arduino" to find the necessary configuration.
3 years ago
David Peter 27f046ec03 Consolidate environment variable lists
We want to make sure that all of our test environments are clean from
possible outside modification. This consolidates the list of used
environment variables in Rust-based and Python-based integration tests.

Note that there is also a similar list in `src/bin/bat/main.rs` which
is even more exhaustive (for bug report collection). However, some
of these variables can not possibly have an effect on test environments.
3 years ago
dependabot[bot] 74ae3dee91 Bump serde_yaml from 0.8.17 to 0.8.20
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.17 to 0.8.20.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.17...0.8.20)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Martin Nordholts 87978e7755
Make asset compression optional at compile time (#1825)
This will be needed to later support zero-copy deserialization of independent
syntax sets, but is interesting and useful on its own.

Instead of deferring serialization and deserialization to syntect, we implement it
ourselves in the same way, but make compression optional.
3 years ago
Martin Nordholts d935ea1cda
Add regression testing for the custom assets functionality (#1829)
The test is following the same steps regular users are instructed to follow:
https://github.com/sharkdp/bat/blob/master/README.md#adding-new-syntaxes--language-definitions
3 years ago
dependabot[bot] 9602195910 Bump assert_cmd from 1.0.8 to 2.0.0
Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd) from 1.0.8 to 2.0.0.
- [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.8...v2.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Martin Nordholts 8ca852c728
CICD: Put documentation testing in its own job (#1831)
For increased parallelization and thus a faster CICD pipeline.
3 years ago