From e7c55bffe9349b67823f195482fa3efc6f5b1321 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Thu, 7 Jan 2021 11:01:41 +0100 Subject: [PATCH 01/27] CICD: Build: Remove unused TARGET_* vars and outputs For #1474 --- .github/workflows/CICD.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 91533085..363a58d2 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -119,11 +119,6 @@ jobs: # parse commit reference info unset REF_TAG ; case ${GITHUB_REF} in refs/tags/*) REF_TAG=${GITHUB_REF#refs/tags/} ;; esac; REF_SHAS=${GITHUB_SHA:0:8} - # parse target - unset TARGET_ARCH ; case ${{ matrix.job.target }} in arm-unknown-linux-gnueabihf) TARGET_ARCH=arm ;; i686-*) TARGET_ARCH=i686 ;; x86_64-*) TARGET_ARCH=x86_64 ;; esac; - echo ::set-output name=TARGET_ARCH::${TARGET_ARCH} - unset TARGET_OS ; case ${{ matrix.job.target }} in *-linux-*) TARGET_OS=linux ;; *-apple-*) TARGET_OS=macos ;; *-windows-*) TARGET_OS=windows ;; esac; - echo ::set-output name=TARGET_OS::${TARGET_OS} # package name PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac; PKG_BASENAME=${PROJECT_NAME}-${REF_TAG:-$REF_SHAS}-${{ matrix.job.target }} From 77d42a17c6d0744c6b6984f01ea95d3213fc9758 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Thu, 7 Jan 2021 11:05:51 +0100 Subject: [PATCH 02/27] CICD: Build: Remove unused PKG_suffix output var Only the env var is used, so output variant is not needed. For #1474 --- .github/workflows/CICD.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 363a58d2..f3760612 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -123,7 +123,6 @@ jobs: PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac; PKG_BASENAME=${PROJECT_NAME}-${REF_TAG:-$REF_SHAS}-${{ matrix.job.target }} PKG_NAME=${PKG_BASENAME}${PKG_suffix} - echo ::set-output name=PKG_suffix::${PKG_suffix} echo ::set-output name=PKG_BASENAME::${PKG_BASENAME} echo ::set-output name=PKG_NAME::${PKG_NAME} # deployable tag? (ie, leading "vM" or "M"; M == version number) From 411d68e8396e92160546769fe5ae47b9964c9882 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Thu, 7 Jan 2021 11:06:40 +0100 Subject: [PATCH 03/27] CICD: Build: Remove unused JOB_DO_TESTING var and output It is CARGO_TEST_OPTIONS that is used to control testing on cross-compiled builds, so we can remove JOB_DO_TESTING. For #1474 --- .github/workflows/CICD.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index f3760612..a224d121 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -153,10 +153,6 @@ jobs: if [[ -n $DPKG_ARCH && -n $DPKG_VERSION ]]; then DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb" ; fi echo ::set-output name=DPKG_NAME::${DPKG_NAME} # target-specific options - # # * `arm` cannot be tested on ubuntu-* hosts (b/c testing is currently primarily done via comparison of target outputs with built-in outputs and the `arm` target is not executable on the host) - JOB_DO_TESTING="true" - case ${{ matrix.job.target }} in arm-*) unset JOB_DO_TESTING ;; esac; - echo ::set-output name=JOB_DO_TESTING::${JOB_DO_TESTING} # # * test only library unit tests and binary for arm-type targets unset CARGO_TEST_OPTIONS unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}" ;; esac; From fed30b1b36e4197beafceb09da1d6273fb0c30a6 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Thu, 7 Jan 2021 15:15:09 +0100 Subject: [PATCH 04/27] Fix theme dir hint in --list-themes output --- src/bin/bat/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index e2862fe9..c3ae75ae 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -205,7 +205,7 @@ pub fn list_themes(cfg: &Config) -> Result<()> { and are added to the cache with `bat cache --build`. \ For more information, see:\n\n \ https://github.com/sharkdp/bat#adding-new-themes", - config_file().join("themes").to_string_lossy() + PROJECT_DIRS.config_dir().join("themes").to_string_lossy() )?; } else { for theme in assets.themes() { From 59f9adc70610a7a30f5c267f2f8f7816e21b1f09 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Thu, 7 Jan 2021 11:39:26 +0100 Subject: [PATCH 05/27] CICD: Build: Add and use disable-deploy matrix var This results in a nicer workflow file that is easier to follow. Also remove the unneccesary doc row that repeats what is already in the matrix and that is annoying to keep up to date. For #1474 --- .github/workflows/CICD.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index a224d121..4847badf 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -83,12 +83,11 @@ jobs: fail-fast: false matrix: job: - # { os, target, cargo-options, features, use-cross } - { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , use-cross: true } - { os: ubuntu-18.04 , target: aarch64-unknown-linux-gnu , use-cross: true } - { os: ubuntu-18.04 , target: i686-unknown-linux-gnu , use-cross: true } - { os: ubuntu-18.04 , target: i686-unknown-linux-musl , use-cross: true } - - { os: ubuntu-18.04 , target: x86_64-unknown-linux-gnu } + - { os: ubuntu-18.04 , target: x86_64-unknown-linux-gnu , disable-deploy: true } ## deployed from ubuntu-16.04 - { os: ubuntu-18.04 , target: x86_64-unknown-linux-musl , use-cross: true } - { os: ubuntu-16.04 , target: x86_64-unknown-linux-gnu } - { os: macos-latest , target: x86_64-apple-darwin } @@ -127,8 +126,6 @@ jobs: echo ::set-output name=PKG_NAME::${PKG_NAME} # deployable tag? (ie, leading "vM" or "M"; M == version number) unset DEPLOY ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DEPLOY='true' ; fi - # unset deploy on ubuntu-18.04 x64 - we will deploy the tarball/deb built on ubuntu-16.04 x64 - if [ "${{ matrix.job.os }}" = "ubuntu-18.04" ] && [ "${{ matrix.job.target }}" = "x86_64-unknown-linux-gnu" ]; then unset DEPLOY; fi echo ::set-output name=DEPLOY::${DEPLOY} # DPKG architecture? unset DPKG_ARCH @@ -350,7 +347,7 @@ jobs: fi - name: Publish archives and packages uses: softprops/action-gh-release@v1 - if: steps.vars.outputs.DEPLOY + if: steps.vars.outputs.DEPLOY && !matrix.job.disable-deploy with: files: | ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }} From e22a9a69b13d4c402ef6972050d04889f21c529d Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Fri, 8 Jan 2021 22:29:19 +0100 Subject: [PATCH 06/27] CICD: Build: Stop building on Ubuntu 16.04 End-of-life is in three months, and we already do the same build on Ubuntu 18.04. --- .github/workflows/CICD.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 4847badf..5b745f25 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -87,9 +87,8 @@ jobs: - { os: ubuntu-18.04 , target: aarch64-unknown-linux-gnu , use-cross: true } - { os: ubuntu-18.04 , target: i686-unknown-linux-gnu , use-cross: true } - { os: ubuntu-18.04 , target: i686-unknown-linux-musl , use-cross: true } - - { os: ubuntu-18.04 , target: x86_64-unknown-linux-gnu , disable-deploy: true } ## deployed from ubuntu-16.04 + - { os: ubuntu-18.04 , target: x86_64-unknown-linux-gnu } - { os: ubuntu-18.04 , target: x86_64-unknown-linux-musl , use-cross: true } - - { os: ubuntu-16.04 , target: x86_64-unknown-linux-gnu } - { os: macos-latest , target: x86_64-apple-darwin } # - { os: windows-latest , target: i686-pc-windows-gnu } ## disabled; error: linker `i686-w64-mingw32-gcc` not found - { os: windows-latest , target: i686-pc-windows-msvc } @@ -347,7 +346,7 @@ jobs: fi - name: Publish archives and packages uses: softprops/action-gh-release@v1 - if: steps.vars.outputs.DEPLOY && !matrix.job.disable-deploy + if: steps.vars.outputs.DEPLOY with: files: | ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }} From c38c186d264ce823463104f300e3a07aafcf5eea Mon Sep 17 00:00:00 2001 From: David Peter Date: Sat, 9 Jan 2021 14:22:23 +0100 Subject: [PATCH 07/27] Add Enselic as a maintainer --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9a31db62..3d894560 100644 --- a/README.md +++ b/README.md @@ -700,6 +700,7 @@ Take a look at the [`CONTRIBUTING.md`](CONTRIBUTING.md) guide. - [sharkdp](https://github.com/sharkdp) - [eth-p](https://github.com/eth-p) - [keith-hall](https://github.com/keith-hall) +- [Enselic](https://github.com/Enselic) ## Project goals and alternatives From 7ffb04a17aeed4815d97f184ead450ceb58d6a6f Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sat, 9 Jan 2021 10:57:47 +0100 Subject: [PATCH 08/27] CICD: Build: Make 'Upload build artifacts' more like deploy The end goal is to upload the same artifacts for a PR as we deploy during a release, to make a regular PR pipeline as similar as possible to a deploy. The first step is to move 'Upload build artifacts' to after 'Package' so we can upload the same files. Also change the name and artifacts to be more similar to what we deploy for a release. For #1474 --- .github/workflows/CICD.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 5b745f25..d3273821 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -227,11 +227,6 @@ jobs: use-cross: ${{ matrix.job.use-cross }} command: check args: --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging - - name: Upload build artifacts - uses: actions/upload-artifact@master - with: - name: ${{ env.PROJECT_NAME }}-${{ matrix.job.target }} - path: target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }} - name: Package shell: bash run: | @@ -344,6 +339,11 @@ jobs: # build dpkg fakeroot dpkg-deb --build "${DPKG_DIR}" "${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }}" fi + - name: Upload build artifacts + uses: actions/upload-artifact@master + with: + name: ${{ steps.vars.outputs.PKG_NAME }} + path: ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }} - name: Publish archives and packages uses: softprops/action-gh-release@v1 if: steps.vars.outputs.DEPLOY From 83c9cb7907a7a6ea48c7c76d51e5a7b0332bf398 Mon Sep 17 00:00:00 2001 From: mark chaitin Date: Wed, 6 Jan 2021 20:17:00 -0500 Subject: [PATCH 09/27] fix bug where long lines were truncated in plain mode without wrap=never not being set --- CHANGELOG.md | 85 +++++++++++++++++++++++----------------------- src/bin/bat/app.rs | 6 ++-- src/output.rs | 2 +- src/printer.rs | 4 ++- src/wrapping.rs | 4 +-- 5 files changed, 52 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 419be6d0..09d8a967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,5 @@ # unreleased - ## Features - Use a pager when `bat --list-languages` is called, see #1394 (@stku1985) @@ -12,6 +11,7 @@ - Make ./tests/syntax-tests/regression_test.sh work on recent versions of macOS, see #1443 (@Enselic) - VimL syntax highlighting fix, see #1450 (@esensar) - Print an 'Invalid syntax theme settings' error message if a custom theme is broken, see #614 (@Enselic) +- If plain mode is set and wrap is not explicitly opted in, long lines will no be truncated, see #1426 ## Other @@ -35,14 +35,12 @@ - `bat` is now available on snapstore with package name called `batcat`, see #1401 (@purveshpatel511) - # v0.17.1 ## Bugfixes - Running `bat` without arguments fails ("output file is also an input"), see #1396 - # v0.17.0 ## Features @@ -71,7 +69,6 @@ - Coldark, see #1329 (@armandphilippot) - # v0.16.0 ## Features @@ -236,11 +233,14 @@ This introduces a `features = ["application"]` which is enabled by default and pulls in everything required by `bat` the application. When depending on bat as a library, downstream `Cargo.toml` should disable this feature to cut out inapplicable heavy dependencies: - ``` toml + + ```toml [dependencies] bat = { version = "0.14", default-features = false } ``` + Other optional functionality has also been put behind features: `paging` and `git` support. + - Allow using the library with older syntect, see #896 and #898 (@dtolnay) ## New syntaxes @@ -248,7 +248,6 @@ - Rego, see #872 (@patrick-east) - Stylo, see #917 - # v0.13.0 ## `bat` as a library @@ -274,6 +273,7 @@ You can see the API documentation here: https://docs.rs/bat/ present. The option now works like this: + ```bash --map-syntax : ``` @@ -281,8 +281,9 @@ You can see the API documentation here: https://docs.rs/bat/ For more information, see the `--help` text, the man page or the README. This new feature allows us to properly highlight files like: - * `/etc/profile` - * `~/.ssh/config` + + - `/etc/profile` + - `~/.ssh/config` - `--highlight-line` now accepts line ranges, see #809 (@lkalir) - Proper wrapping support for output with wide Unicode characters, see #811 #787 and #815 (@Kogia-sima) @@ -350,7 +351,7 @@ You can see the API documentation here: https://docs.rs/bat/ ## Bugfixes -- Fixes a bug for older Windows versions (*"The procedure entry point `CreateFile2` could not be located"*), see #643 (@rivy) +- Fixes a bug for older Windows versions (_"The procedure entry point `CreateFile2` could not be located"_), see #643 (@rivy) # v0.12.0 @@ -487,14 +488,14 @@ You can see the API documentation here: https://docs.rs/bat/ ## Changes -- Use of italics is now *disabled by default* (see #389 for details). They can be +- Use of italics is now _disabled by default_ (see #389 for details). They can be re-enabled by adding `--italic-text=always` to your configuration file. - The default tab-width has been set to 4. - Added new "Sublime Snazzy" theme. -- Shell completions are currently *not* shipped anymore, see #372 for details. +- Shell completions are currently _not_ shipped anymore, see #372 for details. ## Bugfixes @@ -543,7 +544,7 @@ You can see the API documentation here: https://docs.rs/bat/ This allows users to (re)map certain file extensions or file names to an existing syntax: - ``` bash + ```bash bat --map-syntax .config:json ... ``` @@ -672,19 +673,19 @@ You can see the API documentation here: https://docs.rs/bat/ ## Changes -- New themes in `$BAT_CONFIG_DIR/themes` are now loaded *in addition* to +- New themes in `$BAT_CONFIG_DIR/themes` are now loaded _in addition_ to the default themes (they may also override), see #172 - The `Default.tmTheme` symlink is not necessary anymore. ## Bugfixes -* Using `bat cache --init` leads to duplicated syntaxes, see #206 +- Using `bat cache --init` leads to duplicated syntaxes, see #206 ## Other -* Extended and cleaned-up `--help` text. -* Added initial version of a man page, see #52 -* New README sections: *Development* and *Troubleshooting*, see #220 +- Extended and cleaned-up `--help` text. +- Added initial version of a man page, see #52 +- New README sections: _Development_ and _Troubleshooting_, see #220 # v0.5.0 @@ -698,7 +699,7 @@ You can see the API documentation here: https://docs.rs/bat/ ## Changes -- The customization of syntax sets and theme sets is now separated. Syntax definitions are now loaded *in addition* to the ones that are stored in the `bat` binary by default. Please refer to these new sections in the README: [Adding new syntaxes](https://github.com/sharkdp/bat#adding-new-syntaxes--language-definitions), [Adding new themes](https://github.com/sharkdp/bat#adding-new-themes), also see #172 +- The customization of syntax sets and theme sets is now separated. Syntax definitions are now loaded _in addition_ to the ones that are stored in the `bat` binary by default. Please refer to these new sections in the README: [Adding new syntaxes](https://github.com/sharkdp/bat#adding-new-syntaxes--language-definitions), [Adding new themes](https://github.com/sharkdp/bat#adding-new-themes), also see #172 - The color for the filename is now the default foreground color. The colors for the grid and the line numbers is now determined from the syntax highlighting theme, which now also works for light backgrounds, see #178. ## Bugfixes @@ -725,23 +726,23 @@ You can see the API documentation here: https://docs.rs/bat/ ## Features -* Support for line-wrapping, see #54 and #102 (@eth-p) -* New and updated `--style` parameter, see #74 and README (@pitkley) -* Added `--theme` and `--list-themes` options, see #89 (@rleungx) -* Added syntax highlighting for: Julia (@iamed2), Dockerfiles, VimL, CMake, INI, Less -* Added a few popular Sublime Text highlighting themes, see #133 -* Support for bold, italic and underline font styles, see #96 -* Support for 32bit systems is now available, see #84 -* Added `-u` and `-n` options, see #134 -* ANSI color support on Windows 10 +- Support for line-wrapping, see #54 and #102 (@eth-p) +- New and updated `--style` parameter, see #74 and README (@pitkley) +- Added `--theme` and `--list-themes` options, see #89 (@rleungx) +- Added syntax highlighting for: Julia (@iamed2), Dockerfiles, VimL, CMake, INI, Less +- Added a few popular Sublime Text highlighting themes, see #133 +- Support for bold, italic and underline font styles, see #96 +- Support for 32bit systems is now available, see #84 +- Added `-u` and `-n` options, see #134 +- ANSI color support on Windows 10 ## Changes -* The customization folder for own syntaxes has been renamed from `syntax` to `syntaxes`, see README. -* Changed Markdown syntax to the default Sublime Text syntax, see #157 -* Sorted language listing (@rleungx) -* Command line arguments like `--theme` or `--color` can now override themselves. -* Improved `--help` text. +- The customization folder for own syntaxes has been renamed from `syntax` to `syntaxes`, see README. +- Changed Markdown syntax to the default Sublime Text syntax, see #157 +- Sorted language listing (@rleungx) +- Command line arguments like `--theme` or `--color` can now override themselves. +- Improved `--help` text. ## Bugfixes @@ -763,24 +764,24 @@ You can see the API documentation here: https://docs.rs/bat/ ## Features -* Automatic paging by integrating with `less`, see #29 (@BrainMaestro) -* Added support for reading from standard input, see #2 -* Added support for writing to non-interactive terminals (pipes, files, ..); new +- Automatic paging by integrating with `less`, see #29 (@BrainMaestro) +- Added support for reading from standard input, see #2 +- Added support for writing to non-interactive terminals (pipes, files, ..); new `--color=auto/always/never` option, see #26 (@BrainMaestro) -* Added `--list-languages` option to print all available syntaxes, see #69 (@connorkuehl) -* New option to specify the syntax via `-l`/`--language`, see #19 (@BrainMaestro) -* New option to control the output style (`--style`), see #5 (@nakulcg) -* Added syntax highlighting support for TOML files, see #37 +- Added `--list-languages` option to print all available syntaxes, see #69 (@connorkuehl) +- New option to specify the syntax via `-l`/`--language`, see #19 (@BrainMaestro) +- New option to control the output style (`--style`), see #5 (@nakulcg) +- Added syntax highlighting support for TOML files, see #37 ## Changes -* The `init-cache` sub-command has been removed. The cache can now be controlled via +- The `init-cache` sub-command has been removed. The cache can now be controlled via `bat cache`. See `bat cache -h` for all available commands. ## Bug fixes -* Get git repository from file path instead of current directory, see #22 (@nakulcg) -* Process substitution can now be used with bat (`bat <(echo a) <(echo b)`), see #80 +- Get git repository from file path instead of current directory, see #22 (@nakulcg) +- Process substitution can now be used with bat (`bat <(echo a) <(echo b)`), see #80 ## Thanks diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs index 3d0df0ec..34f3f76c 100644 --- a/src/bin/bat/app.rs +++ b/src/bin/bat/app.rs @@ -150,10 +150,10 @@ impl App { wrapping_mode: if self.interactive_output || maybe_term_width.is_some() { match self.matches.value_of("wrap") { Some("character") => WrappingMode::Character, - Some("never") => WrappingMode::NoWrapping, + Some("never") => WrappingMode::NoWrapping(true), Some("auto") | None => { if style_components.plain() { - WrappingMode::NoWrapping + WrappingMode::NoWrapping(false) } else { WrappingMode::Character } @@ -163,7 +163,7 @@ impl App { } else { // We don't have the tty width when piping to another program. // There's no point in wrapping when this is the case. - WrappingMode::NoWrapping + WrappingMode::NoWrapping(false) }, colored_output: self.matches.is_present("force-colorization") || match self.matches.value_of("color") { diff --git a/src/output.rs b/src/output.rs index 689371b9..602bc42e 100644 --- a/src/output.rs +++ b/src/output.rs @@ -101,7 +101,7 @@ impl OutputType { p.arg("--quit-if-one-screen"); } - if wrapping_mode == WrappingMode::NoWrapping { + if wrapping_mode == WrappingMode::NoWrapping(true) { p.arg("--chop-long-lines"); } diff --git a/src/printer.rs b/src/printer.rs index a4b143d4..c4076a98 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -424,7 +424,9 @@ impl<'a> Printer for InteractivePrinter<'a> { } // Line contents. - if self.config.wrapping_mode == WrappingMode::NoWrapping { + if self.config.wrapping_mode == WrappingMode::NoWrapping(false) + || self.config.wrapping_mode == WrappingMode::NoWrapping(true) + { let true_color = self.config.true_color; let colored_output = self.config.colored_output; let italics = self.config.use_italic_text; diff --git a/src/wrapping.rs b/src/wrapping.rs index 6138606e..b854ce75 100644 --- a/src/wrapping.rs +++ b/src/wrapping.rs @@ -1,11 +1,11 @@ #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum WrappingMode { Character, - NoWrapping, + NoWrapping(bool), // explicitly opted in or not } impl Default for WrappingMode { fn default() -> Self { - WrappingMode::NoWrapping + WrappingMode::NoWrapping(false) } } From de6cb75f4bb5d6e65301b5e9a9890228760da4c4 Mon Sep 17 00:00:00 2001 From: mark chaitin Date: Fri, 8 Jan 2021 18:23:11 -0500 Subject: [PATCH 10/27] Addressed PR feedback. Upped min version and used matches! macro --- .github/workflows/CICD.yml | 2 +- CHANGELOG.md | 85 +++++++++++++++++++------------------- README.md | 2 +- doc/README-ru.md | 2 +- src/printer.rs | 4 +- src/wrapping.rs | 3 +- 6 files changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index d3273821..467d1f87 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -5,7 +5,7 @@ env: PROJECT_DESC: "A `cat` clone with wings" PROJECT_MAINTAINER: "David Peter " PROJECT_HOMEPAGE: "https://github.com/sharkdp/bat" - MIN_SUPPORTED_RUST_VERSION: "1.40.0" + MIN_SUPPORTED_RUST_VERSION: "1.42.0" on: [push, pull_request] diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d8a967..0904e9be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # unreleased + ## Features - Use a pager when `bat --list-languages` is called, see #1394 (@stku1985) @@ -17,6 +18,7 @@ - Performance improvements, see #1421 (@LovecraftianHorror) - Added a new `--diagnostic` option to collect information for bug reports, see #1459 (@sharkdp) +- Upped min required Rust version to 1.42 ## Syntaxes @@ -35,12 +37,14 @@ - `bat` is now available on snapstore with package name called `batcat`, see #1401 (@purveshpatel511) + # v0.17.1 ## Bugfixes - Running `bat` without arguments fails ("output file is also an input"), see #1396 + # v0.17.0 ## Features @@ -69,6 +73,7 @@ - Coldark, see #1329 (@armandphilippot) + # v0.16.0 ## Features @@ -233,14 +238,11 @@ This introduces a `features = ["application"]` which is enabled by default and pulls in everything required by `bat` the application. When depending on bat as a library, downstream `Cargo.toml` should disable this feature to cut out inapplicable heavy dependencies: - - ```toml + ``` toml [dependencies] bat = { version = "0.14", default-features = false } ``` - Other optional functionality has also been put behind features: `paging` and `git` support. - - Allow using the library with older syntect, see #896 and #898 (@dtolnay) ## New syntaxes @@ -248,6 +250,7 @@ - Rego, see #872 (@patrick-east) - Stylo, see #917 + # v0.13.0 ## `bat` as a library @@ -273,7 +276,6 @@ You can see the API documentation here: https://docs.rs/bat/ present. The option now works like this: - ```bash --map-syntax : ``` @@ -281,9 +283,8 @@ You can see the API documentation here: https://docs.rs/bat/ For more information, see the `--help` text, the man page or the README. This new feature allows us to properly highlight files like: - - - `/etc/profile` - - `~/.ssh/config` + * `/etc/profile` + * `~/.ssh/config` - `--highlight-line` now accepts line ranges, see #809 (@lkalir) - Proper wrapping support for output with wide Unicode characters, see #811 #787 and #815 (@Kogia-sima) @@ -351,7 +352,7 @@ You can see the API documentation here: https://docs.rs/bat/ ## Bugfixes -- Fixes a bug for older Windows versions (_"The procedure entry point `CreateFile2` could not be located"_), see #643 (@rivy) +- Fixes a bug for older Windows versions (*"The procedure entry point `CreateFile2` could not be located"*), see #643 (@rivy) # v0.12.0 @@ -488,14 +489,14 @@ You can see the API documentation here: https://docs.rs/bat/ ## Changes -- Use of italics is now _disabled by default_ (see #389 for details). They can be +- Use of italics is now *disabled by default* (see #389 for details). They can be re-enabled by adding `--italic-text=always` to your configuration file. - The default tab-width has been set to 4. - Added new "Sublime Snazzy" theme. -- Shell completions are currently _not_ shipped anymore, see #372 for details. +- Shell completions are currently *not* shipped anymore, see #372 for details. ## Bugfixes @@ -544,7 +545,7 @@ You can see the API documentation here: https://docs.rs/bat/ This allows users to (re)map certain file extensions or file names to an existing syntax: - ```bash + ``` bash bat --map-syntax .config:json ... ``` @@ -673,19 +674,19 @@ You can see the API documentation here: https://docs.rs/bat/ ## Changes -- New themes in `$BAT_CONFIG_DIR/themes` are now loaded _in addition_ to +- New themes in `$BAT_CONFIG_DIR/themes` are now loaded *in addition* to the default themes (they may also override), see #172 - The `Default.tmTheme` symlink is not necessary anymore. ## Bugfixes -- Using `bat cache --init` leads to duplicated syntaxes, see #206 +* Using `bat cache --init` leads to duplicated syntaxes, see #206 ## Other -- Extended and cleaned-up `--help` text. -- Added initial version of a man page, see #52 -- New README sections: _Development_ and _Troubleshooting_, see #220 +* Extended and cleaned-up `--help` text. +* Added initial version of a man page, see #52 +* New README sections: *Development* and *Troubleshooting*, see #220 # v0.5.0 @@ -699,7 +700,7 @@ You can see the API documentation here: https://docs.rs/bat/ ## Changes -- The customization of syntax sets and theme sets is now separated. Syntax definitions are now loaded _in addition_ to the ones that are stored in the `bat` binary by default. Please refer to these new sections in the README: [Adding new syntaxes](https://github.com/sharkdp/bat#adding-new-syntaxes--language-definitions), [Adding new themes](https://github.com/sharkdp/bat#adding-new-themes), also see #172 +- The customization of syntax sets and theme sets is now separated. Syntax definitions are now loaded *in addition* to the ones that are stored in the `bat` binary by default. Please refer to these new sections in the README: [Adding new syntaxes](https://github.com/sharkdp/bat#adding-new-syntaxes--language-definitions), [Adding new themes](https://github.com/sharkdp/bat#adding-new-themes), also see #172 - The color for the filename is now the default foreground color. The colors for the grid and the line numbers is now determined from the syntax highlighting theme, which now also works for light backgrounds, see #178. ## Bugfixes @@ -726,23 +727,23 @@ You can see the API documentation here: https://docs.rs/bat/ ## Features -- Support for line-wrapping, see #54 and #102 (@eth-p) -- New and updated `--style` parameter, see #74 and README (@pitkley) -- Added `--theme` and `--list-themes` options, see #89 (@rleungx) -- Added syntax highlighting for: Julia (@iamed2), Dockerfiles, VimL, CMake, INI, Less -- Added a few popular Sublime Text highlighting themes, see #133 -- Support for bold, italic and underline font styles, see #96 -- Support for 32bit systems is now available, see #84 -- Added `-u` and `-n` options, see #134 -- ANSI color support on Windows 10 +* Support for line-wrapping, see #54 and #102 (@eth-p) +* New and updated `--style` parameter, see #74 and README (@pitkley) +* Added `--theme` and `--list-themes` options, see #89 (@rleungx) +* Added syntax highlighting for: Julia (@iamed2), Dockerfiles, VimL, CMake, INI, Less +* Added a few popular Sublime Text highlighting themes, see #133 +* Support for bold, italic and underline font styles, see #96 +* Support for 32bit systems is now available, see #84 +* Added `-u` and `-n` options, see #134 +* ANSI color support on Windows 10 ## Changes -- The customization folder for own syntaxes has been renamed from `syntax` to `syntaxes`, see README. -- Changed Markdown syntax to the default Sublime Text syntax, see #157 -- Sorted language listing (@rleungx) -- Command line arguments like `--theme` or `--color` can now override themselves. -- Improved `--help` text. +* The customization folder for own syntaxes has been renamed from `syntax` to `syntaxes`, see README. +* Changed Markdown syntax to the default Sublime Text syntax, see #157 +* Sorted language listing (@rleungx) +* Command line arguments like `--theme` or `--color` can now override themselves. +* Improved `--help` text. ## Bugfixes @@ -764,24 +765,24 @@ You can see the API documentation here: https://docs.rs/bat/ ## Features -- Automatic paging by integrating with `less`, see #29 (@BrainMaestro) -- Added support for reading from standard input, see #2 -- Added support for writing to non-interactive terminals (pipes, files, ..); new +* Automatic paging by integrating with `less`, see #29 (@BrainMaestro) +* Added support for reading from standard input, see #2 +* Added support for writing to non-interactive terminals (pipes, files, ..); new `--color=auto/always/never` option, see #26 (@BrainMaestro) -- Added `--list-languages` option to print all available syntaxes, see #69 (@connorkuehl) -- New option to specify the syntax via `-l`/`--language`, see #19 (@BrainMaestro) -- New option to control the output style (`--style`), see #5 (@nakulcg) -- Added syntax highlighting support for TOML files, see #37 +* Added `--list-languages` option to print all available syntaxes, see #69 (@connorkuehl) +* New option to specify the syntax via `-l`/`--language`, see #19 (@BrainMaestro) +* New option to control the output style (`--style`), see #5 (@nakulcg) +* Added syntax highlighting support for TOML files, see #37 ## Changes -- The `init-cache` sub-command has been removed. The cache can now be controlled via +* The `init-cache` sub-command has been removed. The cache can now be controlled via `bat cache`. See `bat cache -h` for all available commands. ## Bug fixes -- Get git repository from file path instead of current directory, see #22 (@nakulcg) -- Process substitution can now be used with bat (`bat <(echo a) <(echo b)`), see #80 +* Get git repository from file path instead of current directory, see #22 (@nakulcg) +* Process substitution can now be used with bat (`bat <(echo a) <(echo b)`), see #80 ## Thanks diff --git a/README.md b/README.md index 3d894560..4e953b1c 100644 --- a/README.md +++ b/README.md @@ -356,7 +356,7 @@ binaries are also available: look for archives with `musl` in the file name. ### From source -If you want to build `bat` from source, you need Rust 1.40 or +If you want to build `bat` from source, you need Rust 1.42 or higher. You can then use `cargo` to build everything: ```bash diff --git a/doc/README-ru.md b/doc/README-ru.md index 552fff24..321d3c8c 100644 --- a/doc/README-ru.md +++ b/doc/README-ru.md @@ -341,7 +341,7 @@ ansible-galaxy install aeimer.install_bat ### Из исходников -Если вы желаете установить `bat` из исходников, вам понадобится Rust 1.40 или выше. После этого используйте `cargo`, чтобы все скомпилировать: +Если вы желаете установить `bat` из исходников, вам понадобится Rust 1.42 или выше. После этого используйте `cargo`, чтобы все скомпилировать: ```bash cargo install --locked bat diff --git a/src/printer.rs b/src/printer.rs index c4076a98..45caf157 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -424,9 +424,7 @@ impl<'a> Printer for InteractivePrinter<'a> { } // Line contents. - if self.config.wrapping_mode == WrappingMode::NoWrapping(false) - || self.config.wrapping_mode == WrappingMode::NoWrapping(true) - { + if matches!(self.config.wrapping_mode, WrappingMode::NoWrapping(_)) { let true_color = self.config.true_color; let colored_output = self.config.colored_output; let italics = self.config.use_italic_text; diff --git a/src/wrapping.rs b/src/wrapping.rs index b854ce75..57201750 100644 --- a/src/wrapping.rs +++ b/src/wrapping.rs @@ -1,7 +1,8 @@ #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum WrappingMode { Character, - NoWrapping(bool), // explicitly opted in or not + // The bool specifies whether wrapping has been explicitly disabled by the user via --wrap=never + NoWrapping(bool), } impl Default for WrappingMode { From 09fbabb0b8b278d098765684cdfbfcd928bf209a Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 15:27:28 +0100 Subject: [PATCH 11/27] Add a Default implementation for PrettyPrinter --- src/pretty_printer.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pretty_printer.rs b/src/pretty_printer.rs index cdf22df9..272e073b 100644 --- a/src/pretty_printer.rs +++ b/src/pretty_printer.rs @@ -320,6 +320,12 @@ impl<'a> PrettyPrinter<'a> { } } +impl Default for PrettyPrinter<'_> { + fn default() -> Self { + Self::new() + } +} + /// An input source for the pretty printer. pub struct Input<'a> { input: input::Input<'a>, From 03a2710a0886706621be6d68ce8b0f9bf1ab2d7d Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 15:27:54 +0100 Subject: [PATCH 12/27] =?UTF-8?q?Use=20new=20matches!(=E2=80=A6)=20macro?= =?UTF-8?q?=20to=20simplify=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/input.rs | 6 +----- src/output.rs | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/input.rs b/src/input.rs index 5b6a4e67..1e7aec2f 100644 --- a/src/input.rs +++ b/src/input.rs @@ -137,11 +137,7 @@ impl<'a> Input<'a> { } pub fn is_stdin(&self) -> bool { - if let InputKind::StdIn = self.kind { - true - } else { - false - } + matches!(self.kind, InputKind::StdIn) } pub fn with_name(mut self, provided_name: Option<&OsStr>) -> Self { diff --git a/src/output.rs b/src/output.rs index 602bc42e..de11a9d2 100644 --- a/src/output.rs +++ b/src/output.rs @@ -150,11 +150,7 @@ impl OutputType { #[cfg(feature = "paging")] pub(crate) fn is_pager(&self) -> bool { - if let OutputType::Pager(_) = self { - true - } else { - false - } + matches!(self, OutputType::Pager(_)) } #[cfg(not(feature = "paging"))] From cd7be018fea57e76399290876fe31764b990bafb Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 15:28:21 +0100 Subject: [PATCH 13/27] =?UTF-8?q?Fix=20clippy=20suggestion:=20.or=5Felse(|?= =?UTF-8?q?|=20Some(=E2=80=A6))=20=3D>=20.or(Some(=E2=80=A6))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/bat/input.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/bat/input.rs b/src/bin/bat/input.rs index 9b596274..8e65d800 100644 --- a/src/bin/bat/input.rs +++ b/src/bin/bat/input.rs @@ -2,7 +2,7 @@ use bat::input::Input; use std::ffi::OsStr; pub fn new_file_input<'a>(file: &'a OsStr, name: Option<&'a OsStr>) -> Input<'a> { - named(Input::ordinary_file(file), name.or_else(|| Some(file))) + named(Input::ordinary_file(file), name.or(Some(file))) } pub fn new_stdin_input(name: Option<&OsStr>) -> Input { From 19b8c53c46922b9c6bbd620bb01fd688778c728d Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 19:13:34 +0100 Subject: [PATCH 14/27] Enable clippy::style checks --- .github/workflows/CICD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 467d1f87..9fc9d976 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -27,7 +27,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --all-targets --all-features -- --allow clippy::style + args: --all-targets --all-features - name: Test uses: actions-rs/cargo@v1 with: From 73d14f4655780a4eba0f0664fb7d1e094d885a90 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 19:15:39 +0100 Subject: [PATCH 15/27] Use BatTester::default instead of BatTester::new --- tests/snapshot_tests.rs | 2 +- tests/tester.rs | 36 +++++++++++++++++++----------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/tests/snapshot_tests.rs b/tests/snapshot_tests.rs index 8abb8414..14c3eee1 100644 --- a/tests/snapshot_tests.rs +++ b/tests/snapshot_tests.rs @@ -7,7 +7,7 @@ macro_rules! snapshot_tests { $( #[test] fn $test_name() { - let bat_tester = BatTester::new(); + let bat_tester = BatTester::default(); bat_tester.test_snapshot(stringify!($test_name), $style); } )* diff --git a/tests/tester.rs b/tests/tester.rs index 9c52459f..8a1a0f3b 100644 --- a/tests/tester.rs +++ b/tests/tester.rs @@ -19,23 +19,6 @@ pub struct BatTester { } impl BatTester { - pub fn new() -> Self { - let temp_dir = create_sample_directory().expect("sample directory"); - - let root = env::current_exe() - .expect("tests executable") - .parent() - .expect("tests executable directory") - .parent() - .expect("bat executable directory") - .to_path_buf(); - - let exe_name = if cfg!(windows) { "bat.exe" } else { "bat" }; - let exe = root.join(exe_name); - - BatTester { temp_dir, exe } - } - pub fn test_snapshot(&self, name: &str, style: &str) { let output = Command::new(&self.exe) .current_dir(self.temp_dir.path()) @@ -66,6 +49,25 @@ impl BatTester { } } +impl Default for BatTester { + fn default() -> Self { + let temp_dir = create_sample_directory().expect("sample directory"); + + let root = env::current_exe() + .expect("tests executable") + .parent() + .expect("tests executable directory") + .parent() + .expect("bat executable directory") + .to_path_buf(); + + let exe_name = if cfg!(windows) { "bat.exe" } else { "bat" }; + let exe = root.join(exe_name); + + BatTester { temp_dir, exe } + } +} + fn create_sample_directory() -> Result { // Create temp directory and initialize repository let temp_dir = TempDir::new("bat-tests").expect("Temp directory"); From 6d27df3b7721f0c9e8b00a50d454c2082664da12 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 19:16:07 +0100 Subject: [PATCH 16/27] Use unstable sort for theme test --- tests/assets.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/assets.rs b/tests/assets.rs index d5de9015..fc01d9e8 100644 --- a/tests/assets.rs +++ b/tests/assets.rs @@ -8,7 +8,7 @@ fn all_themes_are_present() { let assets = HighlightingAssets::from_binary(); let mut themes: Vec<_> = assets.themes().collect(); - themes.sort(); + themes.sort_unstable(); assert_eq!( themes, From 8e4b0b4377d5cb33e635d6e2c9ddee061e327597 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 19:53:41 +0100 Subject: [PATCH 17/27] Update dependencies fixes #1149 fixes #1477 --- Cargo.lock | 327 +++++++++++++++++++---------------------------------- 1 file changed, 117 insertions(+), 210 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ced057ca..4fdb3343 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,9 +8,9 @@ checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" [[package]] name = "aho-corasick" -version = "0.7.13" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" dependencies = [ "memchr", ] @@ -50,9 +50,9 @@ checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "assert_cmd" @@ -86,9 +86,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "base64" -version = "0.12.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bat" @@ -143,9 +143,9 @@ dependencies = [ [[package]] name = "bit-vec" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0dc55f2d8a1a85650ac47858bb001b4c0dd73d79e3c455a842925e68d29cd3" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" @@ -155,41 +155,20 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "blake2b_simd" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" +checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" dependencies = [ "arrayref", "arrayvec", "constant_time_eq", ] -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - [[package]] name = "bstr" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +checksum = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf" dependencies = [ "memchr", ] @@ -204,23 +183,17 @@ dependencies = [ "sys-info", ] -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "cc" -version = "1.0.60" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" +checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" dependencies = [ "jobserver", ] @@ -307,21 +280,21 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] name = "crossbeam-utils" -version = "0.7.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" dependencies = [ "autocfg", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "lazy_static", ] @@ -331,15 +304,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array", -] - [[package]] name = "dirs" version = "3.0.1" @@ -368,9 +332,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dtoa" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" +checksum = "88d7ed2934d741c6b37e33e3832298e8850b53fd2d2bea03873375596c7cea4e" [[package]] name = "encode_unicode" @@ -451,12 +415,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "fancy-regex" version = "0.3.5" @@ -469,11 +427,11 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da80be589a72651dcda34d8b35bcdc9b7254ad06325611074d9cc0fbb19f60ee" +checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "crc32fast", "libc", "miniz_oxide", @@ -494,28 +452,29 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" +dependencies = [ + "matches", + "percent-encoding", +] + [[package]] name = "fuchsia-cprng" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -[[package]] -name = "generic-array" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -dependencies = [ - "typenum", -] - [[package]] name = "getrandom" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "wasi", ] @@ -554,15 +513,18 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" +dependencies = [ + "autocfg", +] [[package]] name = "hermit-abi" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151" +checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" dependencies = [ "libc", ] @@ -580,9 +542,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.6.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" +checksum = "4e47a3566dd4fd4eec714ae6ceabdee0caec795be835c223d92c2d40f1e8cf1c" dependencies = [ "autocfg", "hashbrown", @@ -590,9 +552,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jobserver" @@ -617,9 +579,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.78" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa7087f49d294270db4e1928fc110c976cd4b9e5a16348e0a1df09afa99e6c98" +checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929" [[package]] name = "libgit2-sys" @@ -656,9 +618,9 @@ dependencies = [ [[package]] name = "linked-hash-map" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "log" @@ -669,12 +631,6 @@ dependencies = [ "cfg-if 0.1.10", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "matches" version = "0.1.8" @@ -683,15 +639,15 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "memchr" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "miniz_oxide" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9" +checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" dependencies = [ "adler", "autocfg", @@ -717,9 +673,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-integer" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ "autocfg", "num-traits", @@ -727,18 +683,18 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ "autocfg", ] [[package]] name = "onig" -version = "6.1.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a155d13862da85473665694f4c05d77fb96598bdceeaf696433c84ea9567e20" +checksum = "30b46fd9edbc018f0be4e366c24c46db44fac49cd01c039ae85308088b089dd5" dependencies = [ "bitflags", "lazy_static", @@ -748,20 +704,14 @@ dependencies = [ [[package]] name = "onig_sys" -version = "69.5.1" +version = "69.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bff06597a6b17855040955cae613af000fc0bfc8ad49ea68b9479a74e59292d" +checksum = "ed063c96cf4c0f2e5d09324409d158b38a0a85a7b90fbd68c8cad75c495d5775" dependencies = [ "cc", "pkg-config", ] -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - [[package]] name = "path_abs" version = "0.5.0" @@ -786,51 +736,17 @@ dependencies = [ "ucd-trie", ] -[[package]] -name = "pest_derive" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pest_meta" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" -dependencies = [ - "maplit", - "pest", - "sha-1", -] - [[package]] name = "pkg-config" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "plist" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b336d94e8e4ce29bf15bba393164629764744c567e8ad306cc1fdd0119967fd" +checksum = "4dc57ccf442c7414b790e8e7b72fb4d776a66c7680129360946d9aaa6f5311e9" dependencies = [ "base64", "chrono", @@ -855,15 +771,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178" +checksum = "fb3dbeaaf793584e29c58c7e3a82bbb3c7c06b63cea68d13b0e3cddc124104dc" [[package]] name = "predicates-tree" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124" +checksum = "aee95d988ee893cb35c06b148c80ed2cd52c8eea927f50ba7a0be1a786aeab73" dependencies = [ "predicates-core", "treeline", @@ -880,9 +796,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" dependencies = [ "proc-macro2", ] @@ -943,9 +859,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" dependencies = [ "aho-corasick", "memchr", @@ -955,9 +871,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "remove_dir_all" @@ -970,9 +886,9 @@ dependencies = [ [[package]] name = "rust-argon2" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19" +checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" dependencies = [ "base64", "blake2b_simd", @@ -1012,12 +928,11 @@ dependencies = [ [[package]] name = "semver-parser" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e012c6c5380fb91897ba7b9261a0f565e624e869d42fe1a1d03fa0d68a083d5" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" dependencies = [ "pest", - "pest_derive", ] [[package]] @@ -1042,9 +957,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a230ea9107ca2220eea9d46de97eddcb04cd00e92d13dda78e478dd33fa82bd4" +checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" dependencies = [ "itoa", "ryu", @@ -1053,9 +968,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7baae0a99f1a324984bcdc5f0718384c1f69775f1c7eec8b859b71b443e3fd7" +checksum = "971be8f6e4d4a47163b405a3df70d14359186f9ab0f3a3ec37df144ca1ce089f" dependencies = [ "dtoa", "linked-hash-map", @@ -1063,18 +978,6 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "sha-1" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" -dependencies = [ - "block-buffer", - "digest", - "fake-simd", - "opaque-debug", -] - [[package]] name = "shell-words" version = "1.0.0" @@ -1105,9 +1008,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "syn" -version = "1.0.55" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a571a711dddd09019ccc628e1b17fe87c59b09d513c06c026877aa708334f37a" +checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" dependencies = [ "proc-macro2", "quote", @@ -1189,18 +1092,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e" +checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" +checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" dependencies = [ "proc-macro2", "quote", @@ -1209,18 +1112,27 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "bb9bc092d0d51e76b2b19d9d85534ffc9ec2db959a2523cdae0697e2972cd447" dependencies = [ "lazy_static", ] [[package]] name = "tinyvec" -version = "0.3.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" +checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "treeline" @@ -1228,12 +1140,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" -[[package]] -name = "typenum" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" - [[package]] name = "ucd-trie" version = "0.1.3" @@ -1251,9 +1157,9 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.13" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" +checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606" dependencies = [ "tinyvec", ] @@ -1278,10 +1184,11 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "url" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" dependencies = [ + "form_urlencoded", "idna", "matches", "percent-encoding", @@ -1289,9 +1196,9 @@ dependencies = [ [[package]] name = "vcpkg" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" +checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" [[package]] name = "vec_map" @@ -1379,9 +1286,9 @@ checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" [[package]] name = "yaml-rust" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f0c922f1a334134dc2f7a8b67dc5d25f0735263feec974345ff706bcf20b0d" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map", ] From 7c227169a4e174d73605a8ff3180a70d750970ca Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 20:44:44 +0100 Subject: [PATCH 18/27] Add note about breaking change --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0904e9be..5b604aa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,8 +28,8 @@ ## New themes -- `ansi` replaces `ansi-dark` and `ansi-light`, see #1104 and #1412 (@mk12) -- The Gruvbox theme has been updated, see #1291 (@j0hnmeow). **Breaking change:** users that were previously usuing `gruvbox` or `gruvbox-white` should update and use `gruvbox-dark`/`gruvbox-light` instead. +- `ansi` replaces `ansi-dark` and `ansi-light`, see #1104 and #1412 (@mk12). **Breaking change:** users that were previously using one of the `ansi-*` themes should switch to `ansi`. +- The Gruvbox theme has been updated, see #1291 (@j0hnmeow). **Breaking change:** users that were previously using `gruvbox` or `gruvbox-white` should update and use `gruvbox-dark`/`gruvbox-light` instead. ## `bat` as a library From 22924532d0147459646315aead0ba63ba7e2676d Mon Sep 17 00:00:00 2001 From: David Peter Date: Sat, 9 Jan 2021 21:43:25 +0100 Subject: [PATCH 19/27] Fix link in doc/assets.md --- doc/assets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/assets.md b/doc/assets.md index 9aa2a87c..d30d3ab8 100644 --- a/doc/assets.md +++ b/doc/assets.md @@ -23,7 +23,7 @@ in the `.sublime-syntax` format. 5. Use `bat --list-languages` to check if the new languages are available. -6. Add a syntax test for the new language. See [#Syntax-tests](below) for details. +6. Add a syntax test for the new language. See [below](#Syntax-tests) for details. 7. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin` file. A new binary cache file will be created once before every new release of `bat`. From c5c28eb05b89e8dc095da1593b63ea53862800c8 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 21:28:55 +0100 Subject: [PATCH 20/27] --diagnostic: add MANPAGER environment variable --- src/bin/bat/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index c3ae75ae..13d5ddb5 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -237,10 +237,10 @@ fn run() -> Result { .info(EnvironmentVariables::list(&[ "SHELL", "PAGER", + "BAT_PAGER", "BAT_CACHE_PATH", "BAT_CONFIG_PATH", "BAT_OPTS", - "BAT_PAGER", "BAT_STYLE", "BAT_TABS", "BAT_THEME", @@ -248,6 +248,7 @@ fn run() -> Result { "XDG_CACHE_HOME", "COLORTERM", "NO_COLOR", + "MANPAGER", ])) .info(FileContent::new("Config file", config_file())) .info(CompileTimeInformation::default()) From 4c523af1ab4b0fdbb403ae31423bb6cf1dc7f65f Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 21:54:51 +0100 Subject: [PATCH 21/27] Add gnuplot syntax closes #1431 --- .gitmodules | 3 + assets/syntaxes/02_Extra/gnuplot | 1 + .../syntaxes/02_Extra/gnuplot.sublime-syntax | 182 ++++++++++++++++++ .../syntax-tests/highlighted/gnuplot/test.gp | 19 ++ tests/syntax-tests/source/gnuplot/test.gp | 19 ++ 5 files changed, 224 insertions(+) create mode 160000 assets/syntaxes/02_Extra/gnuplot create mode 100644 assets/syntaxes/02_Extra/gnuplot.sublime-syntax create mode 100644 tests/syntax-tests/highlighted/gnuplot/test.gp create mode 100644 tests/syntax-tests/source/gnuplot/test.gp diff --git a/.gitmodules b/.gitmodules index 99364ba6..3dcbc519 100644 --- a/.gitmodules +++ b/.gitmodules @@ -213,3 +213,6 @@ [submodule "assets/syntaxes/02_Extra/Zig"] path = assets/syntaxes/02_Extra/Zig url = https://github.com/ziglang/sublime-zig-language.git +[submodule "assets/syntaxes/02_Extra/gnuplot"] + path = assets/syntaxes/02_Extra/gnuplot + url = https://github.com/hesstobi/sublime_gnuplot diff --git a/assets/syntaxes/02_Extra/gnuplot b/assets/syntaxes/02_Extra/gnuplot new file mode 160000 index 00000000..04743470 --- /dev/null +++ b/assets/syntaxes/02_Extra/gnuplot @@ -0,0 +1 @@ +Subproject commit 04743470ff90237ba3fb34ccf77c2d256d611262 diff --git a/assets/syntaxes/02_Extra/gnuplot.sublime-syntax b/assets/syntaxes/02_Extra/gnuplot.sublime-syntax new file mode 100644 index 00000000..65ca5621 --- /dev/null +++ b/assets/syntaxes/02_Extra/gnuplot.sublime-syntax @@ -0,0 +1,182 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: gnuplot +file_extensions: + - gp + - gpl + - gnuplot + - gnu + - plot + - plt +scope: source.gnuplot +contexts: + main: + - include: number + - include: string_single + - include: string_double + - match: '\b(for)\b\s*(\[)' + comment: | + gnuplot iteration statement. + There are two forms: + numeric [n = 1:2{:inc}] + string based [str in "x y z"] + but both can also iterate over lists etc, so this is kept loose. + captures: + 1: keyword.other.iteration.gnuplot + 2: punctuation.definition.range.begin.gnuplot + push: + - meta_scope: meta.structure.iteration.gnuplot + - match: '\]' + captures: + 0: punctuation.definition.range.end.gnuplot + pop: true + - include: number + - include: operator + - include: string_double + - include: string_single + - match: ":" + scope: punctuation.separator.range.gnuplot + - match: '\b([a-zA-Z]\w*)\b\s*(=|in)' + scope: variable-assignment.range.gnuplot + - match: '(?i:[^\s(pi|e)\]])' + scope: invalid.illegal.expected-range-separator.gnuplot + - match: '\[' + comment: "gnuplot range statement [a:b]. Lots of things are legal, still more make no sense!" + captures: + 0: punctuation.definition.range.begin.gnuplot + push: + - meta_scope: meta.structure.range.gnuplot + - match: '\]' + captures: + 0: punctuation.definition.range.end.gnuplot + pop: true + - include: number + - include: operator + - match: ":" + scope: punctuation.separator.range.gnuplot + - match: '(?i:[^\s(pi|e)\]])' + scope: invalid.illegal.expected-range-separator.gnuplot + - match: \\. + scope: constant.character.escape.gnuplot + - match: '(?|>=|<|<=|&|&&|:|\||\|\||\+|-|\*|\.\*|/|\./|\\|\.\\|\^|\.\^)\s* + comment: Operator symbols + scope: keyword.operator.symbols.matlab + string_double: + - match: '"' + captures: + 0: punctuation.definition.string.begin.gnuplot + push: + - meta_scope: string.quoted.double.gnuplot + - match: '"' + captures: + 0: punctuation.definition.string.end.gnuplot + pop: true + - match: '\\[\$`"\\\n]' + scope: constant.character.escape.gnuplot + string_single: + - match: "'" + captures: + 0: punctuation.definition.string.begin.gnuplot + push: + - meta_scope: string.quoted.single.gnuplot + - match: "'" + captures: + 0: punctuation.definition.string.end.gnuplot + pop: true diff --git a/tests/syntax-tests/highlighted/gnuplot/test.gp b/tests/syntax-tests/highlighted/gnuplot/test.gp new file mode 100644 index 00000000..bb96f60d --- /dev/null +++ b/tests/syntax-tests/highlighted/gnuplot/test.gp @@ -0,0 +1,19 @@ +set terminal pngcairo enhanced +set output "/tmp/polynomial.png" + +set grid + +set xrange [-5:5] +set yrange [-5:10] + +set samples 10000 + +set key bottom right + +f(x) = 1.0 / 14.0 * ((x+4) * (x+1) * (x-1) * (x-3)) + 0.5 + +plot \ + f(x) title "polynomial of degree 4" \ + with lines \ + linewidth 2 \ + linetype rgb '#0077ff' diff --git a/tests/syntax-tests/source/gnuplot/test.gp b/tests/syntax-tests/source/gnuplot/test.gp new file mode 100644 index 00000000..411cf134 --- /dev/null +++ b/tests/syntax-tests/source/gnuplot/test.gp @@ -0,0 +1,19 @@ +set terminal pngcairo enhanced +set output "/tmp/polynomial.png" + +set grid + +set xrange [-5:5] +set yrange [-5:10] + +set samples 10000 + +set key bottom right + +f(x) = 1.0 / 14.0 * ((x+4) * (x+1) * (x-1) * (x-3)) + 0.5 + +plot \ + f(x) title "polynomial of degree 4" \ + with lines \ + linewidth 2 \ + linetype rgb '#0077ff' From 7ada963ec2f66470064c7150eb646c609a4e16ad Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 9 Jan 2021 22:03:48 +0100 Subject: [PATCH 22/27] Add ChangeLog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b604aa6..fe1f80d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - Added Zig syntax, see #1470 (@paulsmith) - Added Lean syntax, see #1446 (@Julian) - Added `.resource` extension for Robot Framework files, see #1386 +- Added `gnuplot` syntax, see #1431 (@sharkdp) ## New themes From 43919066ad3cb12acb62d78758d50624ae297f5d Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sun, 10 Jan 2021 08:55:53 +0100 Subject: [PATCH 23/27] CICD: Use fixed OS versions instead of 'latest' ones This reduces the risk of the build suddenly breaking, and fixes this current warning: Ubuntu-latest workflows will use Ubuntu-20.04 soon. For more details, see https://github.com/actions/virtual-environments/issues/1816 I've use the mapping found at https://github.com/actions/virtual-environments, so there should be no actual change in OS versions, only semantically so. --- .github/workflows/CICD.yml | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 9fc9d976..591b6258 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -12,7 +12,7 @@ on: [push, pull_request] jobs: min_version: name: Minimum supported rust version - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Git checkout uses: actions/checkout@v2 @@ -35,7 +35,7 @@ jobs: test_with_new_syntaxes_and_themes: name: Test with new syntaxes and themes - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Git checkout uses: actions/checkout@v2 @@ -83,17 +83,17 @@ jobs: fail-fast: false matrix: job: - - { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , use-cross: true } - - { os: ubuntu-18.04 , target: aarch64-unknown-linux-gnu , use-cross: true } - - { os: ubuntu-18.04 , target: i686-unknown-linux-gnu , use-cross: true } - - { os: ubuntu-18.04 , target: i686-unknown-linux-musl , use-cross: true } - - { os: ubuntu-18.04 , target: x86_64-unknown-linux-gnu } - - { os: ubuntu-18.04 , target: x86_64-unknown-linux-musl , use-cross: true } - - { os: macos-latest , target: x86_64-apple-darwin } - # - { os: windows-latest , target: i686-pc-windows-gnu } ## disabled; error: linker `i686-w64-mingw32-gcc` not found - - { os: windows-latest , target: i686-pc-windows-msvc } - - { os: windows-latest , target: x86_64-pc-windows-gnu } - - { os: windows-latest , target: x86_64-pc-windows-msvc } + - { os: ubuntu-18.04 , target: arm-unknown-linux-gnueabihf , use-cross: true } + - { os: ubuntu-18.04 , target: aarch64-unknown-linux-gnu , use-cross: true } + - { os: ubuntu-18.04 , target: i686-unknown-linux-gnu , use-cross: true } + - { os: ubuntu-18.04 , target: i686-unknown-linux-musl , use-cross: true } + - { os: ubuntu-18.04 , target: x86_64-unknown-linux-gnu } + - { os: ubuntu-18.04 , target: x86_64-unknown-linux-musl , use-cross: true } + - { os: macos-10.15 , target: x86_64-apple-darwin } + # - { os: windows-2019 , target: i686-pc-windows-gnu } ## disabled; error: linker `i686-w64-mingw32-gcc` not found + - { os: windows-2019 , target: i686-pc-windows-msvc } + - { os: windows-2019 , target: x86_64-pc-windows-gnu } + - { os: windows-2019 , target: x86_64-pc-windows-msvc } steps: - name: Git checkout uses: actions/checkout@v2 @@ -361,11 +361,10 @@ jobs: strategy: fail-fast: true matrix: - # job: [ { os: ubuntu-latest }, { os: macos-latest }, { os: windows-latest } ] job: - - { os: ubuntu-latest , toolchain: nightly-2020-04-29 } - - { os: macos-latest , toolchain: nightly-2020-04-29 } - - { os: windows-latest , toolchain: nightly-2020-04-29-x86_64-pc-windows-gnu } + - { os: ubuntu-18.04 , toolchain: nightly-2020-04-29 } + - { os: macos-10.15 , toolchain: nightly-2020-04-29 } + - { os: windows-2019 , toolchain: nightly-2020-04-29-x86_64-pc-windows-gnu } steps: - uses: actions/checkout@v2 - name: Initialize workflow variables From 9a3a5545e70d10f62d645e5f553b75ae13feb755 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sat, 9 Jan 2021 20:53:54 +0100 Subject: [PATCH 24/27] CICD: Build: Use Cargo.toml version instead of tag This enables us to later always build Debian packages. If you try to use a git sha as Debian package version you will get an error: dpkg-deb: error: parsing file '_staging/dpkg/DEBIAN/control' near line 2 package 'bat': error in 'Version' field string 'd2963ce4': version number does not start with digit so we need to use a version that is always available. We duplicate the bat version in another place here which is a bit bad, but it is already duplicated a lot, so we don't make things significantly worse. It is still kind of nice to not have to figure out a good and robust way to parse out the version from Cargo.toml in the CI script. For #1474 --- .github/workflows/CICD.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 591b6258..d4c29cdd 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -2,6 +2,7 @@ name: CICD env: PROJECT_NAME: bat + PROJECT_VERSION: "0.17.1" PROJECT_DESC: "A `cat` clone with wings" PROJECT_MAINTAINER: "David Peter " PROJECT_HOMEPAGE: "https://github.com/sharkdp/bat" @@ -116,10 +117,9 @@ jobs: echo ::set-output name=EXE_suffix::${EXE_suffix} # parse commit reference info unset REF_TAG ; case ${GITHUB_REF} in refs/tags/*) REF_TAG=${GITHUB_REF#refs/tags/} ;; esac; - REF_SHAS=${GITHUB_SHA:0:8} # package name PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac; - PKG_BASENAME=${PROJECT_NAME}-${REF_TAG:-$REF_SHAS}-${{ matrix.job.target }} + PKG_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-${{ matrix.job.target }} PKG_NAME=${PKG_BASENAME}${PKG_suffix} echo ::set-output name=PKG_BASENAME::${PKG_BASENAME} echo ::set-output name=PKG_NAME::${PKG_NAME} From 505ff10dc629b65d81630180d59960c369c39539 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sat, 9 Jan 2021 20:59:23 +0100 Subject: [PATCH 25/27] CICD: Build: Always build and upload Debian packages Not only when a release tag is pushed. Also publish these Debian packages as artifacts. This makes PR workflows more similar to release work flows, and reduces risk of build system regressions that we don't detect until we make a new release. For #1474 --- .github/workflows/CICD.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index d4c29cdd..11d62fc1 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -135,8 +135,7 @@ jobs: x86_64-*-linux-*) DPKG_ARCH=amd64 ;; esac; echo ::set-output name=DPKG_ARCH::${DPKG_ARCH} - # DPKG version? - unset DPKG_VERSION ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DPKG_VERSION=${REF_TAG/#[vV]/} ; fi + DPKG_VERSION=${PROJECT_VERSION} echo ::set-output name=DPKG_VERSION::${DPKG_VERSION} # DPKG base name/conflicts? DPKG_BASENAME=${PROJECT_NAME} @@ -339,11 +338,17 @@ jobs: # build dpkg fakeroot dpkg-deb --build "${DPKG_DIR}" "${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }}" fi - - name: Upload build artifacts + - name: Upload package artifact uses: actions/upload-artifact@master with: name: ${{ steps.vars.outputs.PKG_NAME }} path: ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }} + - name: Upload Debian package artifact + uses: actions/upload-artifact@master + if: steps.vars.outputs.DPKG_NAME + with: + name: ${{ steps.vars.outputs.DPKG_NAME }} + path: ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }} - name: Publish archives and packages uses: softprops/action-gh-release@v1 if: steps.vars.outputs.DEPLOY From 8832ff3c6a0eafae6eded3389c83739b0719a355 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sat, 9 Jan 2021 21:08:31 +0100 Subject: [PATCH 26/27] CICD: Build: Adapt release version regex to bat All bat tags begin with a small 'v', so no need for a generic pattern in the CI script. This will also help us ensure we keep the same format on future tags. --- .github/workflows/CICD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 11d62fc1..b2753d0d 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -124,7 +124,7 @@ jobs: echo ::set-output name=PKG_BASENAME::${PKG_BASENAME} echo ::set-output name=PKG_NAME::${PKG_NAME} # deployable tag? (ie, leading "vM" or "M"; M == version number) - unset DEPLOY ; if [[ $REF_TAG =~ ^[vV]?[0-9].* ]]; then DEPLOY='true' ; fi + unset DEPLOY ; if [[ $REF_TAG =~ ^v[0-9].* ]]; then DEPLOY='true' ; fi echo ::set-output name=DEPLOY::${DEPLOY} # DPKG architecture? unset DPKG_ARCH From e3b114236452dc5a9084f623b3bd4b39100edd15 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sat, 9 Jan 2021 21:10:11 +0100 Subject: [PATCH 27/27] CICD: Build: DEPLOY -> IS_RELEASE and inline it This simplifies and clarifies the script. For #1474 --- .github/workflows/CICD.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index b2753d0d..0899efee 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -115,17 +115,14 @@ jobs: # determine EXE suffix EXE_suffix="" ; case ${{ matrix.job.target }} in *-pc-windows-*) EXE_suffix=".exe" ;; esac; echo ::set-output name=EXE_suffix::${EXE_suffix} - # parse commit reference info - unset REF_TAG ; case ${GITHUB_REF} in refs/tags/*) REF_TAG=${GITHUB_REF#refs/tags/} ;; esac; # package name PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac; PKG_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-${{ matrix.job.target }} PKG_NAME=${PKG_BASENAME}${PKG_suffix} echo ::set-output name=PKG_BASENAME::${PKG_BASENAME} echo ::set-output name=PKG_NAME::${PKG_NAME} - # deployable tag? (ie, leading "vM" or "M"; M == version number) - unset DEPLOY ; if [[ $REF_TAG =~ ^v[0-9].* ]]; then DEPLOY='true' ; fi - echo ::set-output name=DEPLOY::${DEPLOY} + unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi + echo ::set-output name=IS_RELEASE::${IS_RELEASE} # DPKG architecture? unset DPKG_ARCH case ${{ matrix.job.target }} in @@ -351,7 +348,7 @@ jobs: path: ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.DPKG_NAME }} - name: Publish archives and packages uses: softprops/action-gh-release@v1 - if: steps.vars.outputs.DEPLOY + if: steps.vars.outputs.IS_RELEASE with: files: | ${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_NAME }}