Commit Graph

2296 Commits (f6ce5d2054cc7ac2d556358e5b87370bd66b2bc8)
 

Author SHA1 Message Date
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
dependabot[bot] df067f7d1f Bump predicates from 2.0.1 to 2.0.2
Bumps [predicates](https://github.com/assert-rs/predicates-rs) from 2.0.1 to 2.0.2.
- [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/v2.0.1...v2.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
dependabot[bot] a8a81e99d2 Bump nix from 0.22.0 to 0.22.1
Bumps [nix](https://github.com/nix-rust/nix) from 0.22.0 to 0.22.1.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/v0.22.1/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.22.0...v0.22.1)

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

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

---
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
Ville Skyttä 7c41bd72da assets: add Debian ucf backups to ignored suffixes
Refs https://manpages.debian.org/bullseye/ucf/ucf.1.en.html
3 years ago
Martin Nordholts 355a82db54 CICD: Sort build matrix by target 3 years ago
Martin Nordholts b3e17bde82 CICD: Remove disabled windows-2019 i686-pc-windows-gnu from build matrix
It just messes up alignment. Nothing gets better by keeing it around.
3 years ago
Martin Nordholts 4b38e7b1d7 CICD: Swap target and os in matrix job name
The full name can frequently not be shown, and target is more relevant than os,
so show target first.
3 years ago
Rashil Gandhi 43afae34be
Add PowerShell completion file (#1826) 3 years ago
Martin Nordholts 27fa55d274
src/build_assets.rs: Refactor into smaller functions (#1822)
To make the code easier to work with.
3 years ago
Martin Nordholts 19c3e82abf
Replace deprecated 'error-chain' with 'thiserror' (#1820)
We can't use #[from] on Error::Msg(String) because String does not implement Error.
(Which it shouldn't; see e.g. https://internals.rust-lang.org/t/impl-error-for-string/8881.)
So we implement From manually for Error::Msg, since our current code was written
in that way for error-chain.
3 years ago
Martin Nordholts f1c0fd7343
Don't take a HighlightingAssets detour to build assets (#1802)
Move code to build assets to its own file. That results in better modularity and flexibility.

It also allows us to simplify HighlightingAssets a lot, since it will now always
be initialized with a SerializedSyntaxSet.
3 years ago
Martin Nordholts 12dfbdc400
doc/release-checklist.md: Recommend git push origin tag vX.Y.Z (#1815) 3 years ago
Bojan Durdevic c86a179412 PR comments addressed for line range +delta syntax 3 years ago
Bojan Durdevic 0748783404 Support for line range plus syntax 3 years ago
Martin Nordholts b3247d9364 Merge the v0.18.3 hotfix release into master
The v0.18.3 release was a hotfix release to make bat build again with Rust 1.54.
This merge commit brings in all changes from the hotfix release into the master
branch.

In practice, this only brings in one new commit, namely b146958ec. The other
three commits in the release were cherry-picks from master.
3 years ago
Martin Nordholts ba8a694314 Add LANG and LC_ALL to --diagnostics output
To make it easier to debug problems like #1806 in the future.
3 years ago
Martin Nordholts b146958ecb Bump version to v0.18.3 3 years ago
David Peter ff70a80741 Add statically linked binaries for ARM 3 years ago
David Peter ecdb17148d Use Ubuntu 20.04 instead of 18.04 3 years ago
David Peter 11bd523f7e Remove post-release section 3 years ago
David Peter 01fbedc246 Formatting 3 years ago
David Peter 05e4e1f2f2 Add refined version of release checklist 3 years ago
David Peter 20223ad77c Add old release checklist 3 years ago
a1346054 51edacb5eb style: trim excess whitespace 3 years ago
a1346054 5197ef9048 fix: spelling 3 years ago
a1346054 19678527e5 chore(find-slow-to-highlight-files.py): be explicit about using python3
In many distros, `python` no longer leads to anything, and instead
`python2` or `python3` need to be explicitly run.
3 years ago
a1346054 5d319dee94 style(create.sh): remove non-POSIX keyword 3 years ago
Martin Nordholts 15c701b196 Bump bugreport to 0.4.1
(cherry picked from commit f6975e2acd)
3 years ago
David Peter d8339808a1 Update git2 dependency to fix incompatibility with Rust 1.54
(cherry picked from commit f3d53b79a2)
3 years ago
bl-ue 3b263f0917 Fix typo in README
(cherry picked from commit fc0794a83d)
3 years ago
Ville Skyttä 43e1a11ad8 Make Package Control reference a link 3 years ago
Martin Nordholts ed09f90e5e Fix all lints that are new with Rust 1.54
They are all of the following type:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
3 years ago
Martin Nordholts cbd96237fd CICD: Add 'cargo fmt' check 3 years ago
Martin Nordholts f5c1cb2dff Run 'cargo fmt' 3 years ago
Keith Hall 5eb93a6eae
Merge pull request #1800 from sharkdp/syslog_no_colon_after_process
Fix syslog syntax highlighting when no colon after "process"
3 years ago