diff options
author | Martin Nordholts <enselic@gmail.com> | 2022-09-04 20:44:23 +0200 |
---|---|---|
committer | Martin Nordholts <enselic@gmail.com> | 2022-09-04 20:44:23 +0200 |
commit | 2dd2994b2f106ef7d2af83d0961cadfea759d339 (patch) | |
tree | 94d9a02e8c9512c74ed6f57551c9409e17d9d797 | |
parent | 6b660ef63a94154c0e0ce05ae898b3283c090c4b (diff) | |
parent | 48541b850768a2534a6a55491353eebbdf9f668f (diff) |
Merge remote-tracking branch 'origin/master' into feature/668/add-systemwide-config
75 files changed, 1535 insertions, 925 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index aedf6e9c..b1732b43 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,9 +7,26 @@ assignees: '' --- -<!-- Hey there, thank you for creating an issue! --> +<!-- + +Hey there, thank you for reporting a bug! + +Please note that the following bugs have already been reported: + +* dpkg: error processing archive /some/path/some-program.deb (--unpack): + trying to overwrite '/usr/.crates2.json' + + See https://github.com/sharkdp/bat/issues/938 + +--> + +**What steps will reproduce the bug?** + +1. step 1 +2. step 2 +3. ... -**Describe the bug you encountered:** +**What happens?** ... diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index c2ad5607..d8c95bc5 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -7,3 +7,5 @@ assignees: '' --- +<!-- Using a normal ticket is still fine, but feel free to ask your +questions about bat on https://github.com/sharkdp/bat/discussions instead. --> diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 710bd4f2..2ccb2f32 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -1,7 +1,7 @@ name: CICD env: - MIN_SUPPORTED_RUST_VERSION: "1.51.0" + MIN_SUPPORTED_RUST_VERSION: "1.60.0" CICD_INTERMEDIATES_DIR: "_cicd-intermediates" on: @@ -39,6 +39,8 @@ jobs: min_version: name: Minimum supported rust version runs-on: ubuntu-20.04 + env: + MSRV_FEATURES: --no-default-features --features minimal-application,bugreport,build-assets steps: - name: Checkout source code uses: actions/checkout@v2 @@ -54,12 +56,12 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --locked --all-targets --all-features + args: --locked --all-targets ${{ env.MSRV_FEATURES }} - name: Run tests uses: actions-rs/cargo@v1 with: command: test - args: --locked + args: --locked ${{ env.MSRV_FEATURES }} test_with_new_syntaxes_and_themes: name: Run tests with updated syntaxes and themes @@ -144,6 +146,18 @@ jobs: toolchain: stable default: true profile: minimal + - name: Print -h + uses: actions-rs/cargo@v1 + with: + command: run + args: --locked -- -h + - name: Print --help + uses: actions-rs/cargo@v1 + with: + command: run + args: --locked -- --help + - name: Show man page + run: man $(find . -name bat.1) - name: Check documentation env: RUSTDOCFLAGS: -D warnings @@ -168,7 +182,7 @@ jobs: - { target: x86_64-apple-darwin , os: macos-10.15 } - { target: x86_64-pc-windows-gnu , os: windows-2019 } - { target: x86_64-pc-windows-msvc , os: windows-2019 } - - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 } + - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true } - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true } steps: - name: Checkout source code diff --git a/.gitmodules b/.gitmodules index 50616ed2..156f4206 100644 --- a/.gitmodules +++ b/.gitmodules @@ -239,3 +239,8 @@ [submodule "assets/syntaxes/02_Extra/SublimeJQ"] path = assets/syntaxes/02_Extra/SublimeJQ url = https://github.com/zogwarg/SublimeJQ.git +[submodule "assets/syntaxes/02_Extra/cmd-help"] + path = assets/syntaxes/02_Extra/cmd-help + url = https://github.com/victor-gp/cmd-help-sublime-syntax.git + branch = main + shallow = true diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c193aee..c06342b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,22 +2,75 @@ ## Features -- Correctly render tab stops in --show-all, see #2038 (@Synthetica9) +- Make the default macOS theme depend on Dark Mode. See #2197, #1746 (@Enselic) ## Bugfixes +- Prevent fork nightmare with `PAGER=batcat`. See #2235 (@johnmatthiggins) +- Make `--no-paging`/`-P` override `--paging=...` if passed as a later arg, see #2201 (@themkat) +- `--map-syntax` and `--ignored-suffix` now works together, see #2093 (@czzrr) + ## Other -- Include contents of custom assets `metadata.yaml` in `--diagnostics`. See #2107 (@Enselic) +- Relaxed glibc requirements on amd64, see #2106 and #2194 (@sharkdp) +- Improved fish completions. See #2275 (@zgracem) +- Stop pre-processing ANSI escape characters. Syntax highlighting on ANSI escaped input is not supported. See #2185 and #2189 (@Enselic) ## Syntaxes -- Mapped clang-format config file (.clang-format) to YAML syntax (@TruncatedDinosour) +- NSE (Nmap Scripting Engine) is mapped to Lua, see #2151 (@Cre3per) +- Correctly color `fstab` dump and pass fields, see #2246 (@yuvalmo) +- Update `Command Help` syntax, see #2255 +- `Julia`: Fix syntax highlighting for function name starting with `struct`, see #2230 +- Minor update to `LiveScript`, see #2291 ## Themes ## `bat` as a library +- Make `bat::PrettyPrinter::syntaxes()` iterate over new `bat::Syntax` struct instead of `&syntect::parsing::SyntaxReference`. See #2222 (@Enselic) + + +# v0.21.0 + +## Features + +- Correctly render tab stops in `--show-all`, see #2038 (@Synthetica9) +- Add a `--style=default` option and make it the default. It is less verbose than `full`, see #2061 (@IsaacHorvath) +- Enable BusyBox `less` as pager, see #2162 (@nfisher1226) +- File extensions are now matched case-insensitively. See #1854, #2181 (@Enselic) + +## Bugfixes + +- Bump `regex` dependency from 1.5.4 to 1.5.5 to fix [CVE-2022-24713](https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html), see #2145, #2139 (@Enselic) +- `bat` no longer crashes when encountering files that references missing syntaxes. See #915, #2181 (@Enselic) + +## Performance + +- Skip syntax highlighting on long lines (> 16384 chars) to help improve performance. See #2165 (@keith-hall) +- Vastly improve startup time by lazy-loading syntaxes via syntect 5.0.0. This makes bat display small files ~75% faster than before. See #951, #2181 (@Enselic) + +## Other + +- Include info about custom assets in `--diagnostics` if used. See #2107, #2144 (@Enselic) + +## Syntaxes + +- Mapped clang-format config file (.clang-format) to YAML syntax (@TruncatedDinosour) +- log syntax: improved handling of escape characters in double quoted strings. See #2123 (@keith-hall) +- Associate `/var/spool/mail/*` and `/var/mail/*` with the `Email` syntax. See #2156 (@cyqsimon) +- Added cmd-help syntax to scope --help messages. See #2148 (@victor-gp) +- Slightly adjust Zig syntax. See #2136 (@Enselic) +- Associate `.inf` files with the `INI` syntax. See #2190 (@Enselic) + +## `bat` as a library + +- Allow configuration of `show_nonprintable` with `PrettyPrinter`, see #2142 +- The binary format of syntaxes.bin has been changed due to syntaxes now being lazy-loaded via syntect 5.0.0. See #2181 (@Enselic) +- Mark `bat::error::Error` enum as `#[non_exhaustive]` to allow adding new variants without future semver breakage. See #2181 (@Enselic) +- Change `Error::SyntectError(syntect::LoadingError)` to `Error::SyntectError(syntect::Error)`. See #2181 (@Enselic) +- Add `Error::SyntectLoadingError(syntect::LoadingError)` enum variant. See #2181 (@Enselic) + # v0.20.0 @@ -74,7 +74,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bat" -version = "0.20.0" +version = "0.21.0" dependencies = [ "ansi_colours", "ansi_term", @@ -155,9 +155,9 @@ dependencies = [ [[package]] name = "bugreport" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0014b4b2b4f63bfe69c3838470121290cc437fdc79785d408a761a21e8b2404c" +checksum = "535120b8182547808081a66f1f77a64533c780b23da26763e0ee34dfb94f98c9" dependencies = [ "git-version", "shell-escape", @@ -193,18 +193,28 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "2.34.0" +version = "3.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd" dependencies = [ - "ansi_term", "atty", "bitflags", + "clap_lex", + "indexmap", + "once_cell", "strsim", - "term_size", + "termcolor", + "terminal_size", "textwrap", - "unicode-width", - "vec_map", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", ] [[package]] @@ -221,14 +231,13 @@ dependencies = [ [[package]] name = "console" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31" +checksum = "89eab4d20ce20cea182308bca13088fecea9c05f6776cf287205d41a0ed3c847" dependencies = [ "encode_unicode", "libc", "once_cell", - "regex", "terminal_size", "unicode-width", "winapi", @@ -382,13 +391,11 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ - "cfg-if", "crc32fast", - "libc", "miniz_oxide", ] @@ -452,9 +459,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7d3b96ec1fcaa8431cf04a4f1ef5caafe58d5cf7bcc31f09c1626adddb0ffe" +checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" dependencies = [ "bitflags", "libc", @@ -471,9 +478,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "globset" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" +checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" dependencies = [ "aho-corasick", "bstr", @@ -581,22 +588,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] name = "libc" -version = "0.2.112" +version = "0.2.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" +checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" [[package]] name = "libgit2-sys" -version = "0.13.1+1.4.2" +version = "0.14.0+1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e598aa7a4faedf1ea1b4608f582b06f0f40211eec551b7ef36019ae3f62def" +checksum = "47a00859c70c8a4f7218e6d1cc32875c4b55f6799445b842b0d8ed5e4c3d959b" dependencies = [ "cc", "libc", @@ -662,35 +663,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" dependencies = [ "adler", - "autocfg", ] [[package]] name = "nix" -version = "0.23.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" +checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" dependencies = [ "bitflags", - "cc", "cfg-if", "libc", - "memoffset", ] [[package]] @@ -710,9 +699,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.9.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" [[package]] name = "onig" @@ -737,6 +726,12 @@ dependencies = [ ] [[package]] +name = "os_str_bytes" +version = "6.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" + +[[package]] name = "parking_lot" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -858,11 +853,11 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -895,9 +890,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.4" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -912,9 +907,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "remove_dir_all" @@ -969,24 +964,24 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "semver" -version = "1.0.6" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d" +checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" [[package]] name = "serde" -version = "1.0.136" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", @@ -1006,9 +1001,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0" +checksum = "707d15895415db6628332b737c838b88c598522e4dc70647e59b72312924aebc" dependencies = [ "indexmap", "ryu", @@ -1066,26 +1061,26 @@ checksum = "8207e78455ffdf55661170876f88daf85356e4edd54e0a3dbc79586ca1e50cbe" [[package]] name = "strsim" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0. |