Commit Graph

540 Commits

Author SHA1 Message Date
fe73010a5e ignore failing test 2023-09-08 06:25:20 +02:00
433176ab54 require LESSOPEN to have exactly one %s 2023-09-08 06:25:20 +02:00
b56021ffa9 make LESSOPEN support opt-in 2023-09-08 06:25:20 +02:00
d6e11b59e7 #2592: Fixes unit tests dependent on echo on windows (#2602)
Co-authored-by: Boy van Duuren <boy.van.duuren@rabobank.nl>
2023-09-08 06:18:25 +02:00
e32ad0b048 Add $LESSOPEN and $LESSCLOSE support (#2444) 2023-09-02 08:48:26 +02:00
4b04f901fe Add test for BAT_PAGING 2023-09-01 17:59:41 +02:00
32c0e1fb45 update highlighted test file 2023-09-01 17:50:30 +02:00
34440f1b0c update highlighted test file 2023-09-01 17:50:30 +02:00
f1d6cc7a64 add test files for NSIS syntax 2023-09-01 17:50:30 +02:00
b65a02681a Add crontab syntax 2023-03-17 22:48:12 +02:00
8f99a78cf1 Print non-printable characters using caret notation (#2443)
When the new flag is set, non-printable characters are printed using caret notation.
2023-03-14 22:21:30 +01:00
5e77ca37e8 More consistent scoping in commands section in Manpages 2023-03-04 16:51:39 +01:00
52ef1bc0d6 Scope environment variable and commands sections in Manpages 2023-02-05 16:56:54 +01:00
5cd77662b5 Merge pull request #2430 from Enselic/blessable-help
Require changes to `-h` and `--help` to be blessed
2023-01-17 15:29:13 +01:00
4e34b362f8 Require changes to -h and --help to be blessed
From now on, any changes to the help texts will be visible in PR diffs,
which will make it very easy to review, and very hard to accidentally
miss changes to help texts.

If a contributor makes a change to help texts, the `cargo test` failure
text they will see contains instructions on how to update the blessed
help texts:

    error: expect test failed
       --> ../doc/long-help.txt

    You can update all `expect!` tests by running:

        env UPDATE_EXPECT=1 cargo test

In short, to update blessed help texts, one simply does

    env UPDATE_EXPECT=1 cargo test

Do not run the tests if the `git` feature is missing, since then
`--diff` will be missing from `--help`. And do not run the tests on
Windows, because then the help text will contain the term `.exe`.

Move man page step to after cargo doc step so that the man page exists
when we look for it.
2022-12-30 09:59:52 +01:00
3ffa7edbd5 Bump cmd-help syntax to latest
This update includes an overhaul of scope names to better support the
set of themes included with bat.

You can find a visual diff for every theme in this PR:
https://github.com/victor-gp/cmd-help-sublime-syntax/pull/17

This commit updates the cmd-help syntax test because the scopes (-> colors)
have changed.
2022-12-07 04:02:05 +01:00
e39178b101 Fix bat cache --clear not clearing the --target dir if specified 2022-11-19 18:00:37 +08:00
accc1b6d10 Merge pull request #2366 from Freed-Wu/vimhelp
Add VimHelp.sublime-syntax and its test
2022-11-04 22:07:57 +01:00
1224403aa1 Update comments in tests/integration_tests.rs 2022-11-02 17:09:15 -04:00
1a07baf5f2 Update tests/integration_tests.rs
Co-authored-by: David Peter <sharkdp@users.noreply.github.com>
2022-11-02 16:48:51 -04:00
bad2292950 Add tests for --theme > BAT_THEME > config 2022-11-02 16:48:51 -04:00
e773b48135 Fix cache subcommand and add tests
Treat the cache subcommand differently from --no-config:
For --no-config, insert args from selected environment variables
For cache, don't insert args
2022-11-02 16:48:51 -04:00
76aad7c74f Improve correctness and add more tests 2022-11-02 16:48:50 -04:00
36ccc6a31e Allow env vars to override config but not args 2022-11-02 16:48:50 -04:00
4724d50e1d Merge pull request #2361 from Freed-Wu/main
Add Requirementstxt.sublime-syntax and its test.
2022-11-02 21:00:33 +01:00
14742a82bd Merge branch 'master' into master 2022-10-30 21:08:04 +01:00
8e15c9c501 Merge pull request #2316 from dkm/pr/ada_syntax
Add syntax support for Ada
2022-10-30 19:56:07 +01:00
3c9c960612 Merge pull request #2309 from johnmatthiggins/master
Added -S flag for truncating long lines
2022-10-30 17:36:09 +01:00
37da5659c5 Add VimHelp.sublime-syntax and its test 2022-10-30 13:40:41 +08:00
6010b334c6 Add Requirementstxt.sublime-syntax and its test. 2022-10-30 13:33:12 +08:00
31f964f468 fix(syntax): Use variable.other for TodoTxt attrs 2022-10-29 16:55:46 +03:00
316f1b3601 test(syntax): Generate normal highlight for bat 2022-10-22 17:06:27 +03:00
1a85b4c3b5 test(syntax): Add partially working test 2022-10-22 16:59:19 +03:00
bf114f5844 Added helper function for -S flag tests 2022-10-17 14:43:02 -07:00
wzy
f215d07366 Improve Manpage.sublime-syntax, Fix #2353 (#2364)
* Improve Manpage.sublime-syntax, Fix #2353

* Add highlight tests for fzf-0.33.0
2022-10-17 19:56:17 +02:00
236a2c5794 Fixed inverted logic on -S and --chop-long-lines 2022-10-13 23:52:15 -07:00
03216c9c18 Merge branch 'sharkdp:master' into master 2022-10-09 22:56:11 -07:00
8f31ffa9df Added integration tests 2022-10-09 22:42:11 -07:00
06b403aa92 Add syntax support for Ada
Add submodule with sublime syntax.

Add corresponding tests for both Ada (in adb/ads) and for the companion tool
gpr.

fixes #1300

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-09-14 22:49:39 +02:00
352309b056 Revert "Remove code that tries to handle ANSI escape inputs"
This reverts commit 8174e02279. Turns out
it is needed for a common use case, see
https://github.com/sharkdp/bat/issues/2307.

It is not a clean revert, because I adjust CHANGELOG.md and also add a
comment to the test. I also had to resolve a small `use` conflict.
2022-09-10 17:59:33 +02:00
08386daa3a Strip BOM from output in interactive mode (#1938)
* Strip BOM from output in interactive mode

* Strip BOM when not loop_through, add regression tests

* Update CHANGELOG.md

* Only strip BOM from beginning of first line

* Fix integration test on macOS that relied on color scheme

* Fix integration test on Windows that relied on detected terminal width

* Fix syntax test that was failing due to a previously wrong (now fixed) highlighting

Co-authored-by: David Peter <mail@david-peter.de>
Co-authored-by: Martin Nordholts <enselic@gmail.com>
2022-09-06 19:08:38 +02:00
Kid
d6d8b61131 Fix highlight test 2022-09-04 22:22:18 +02:00
Kid
839e62cff8 Map fish_history to YAML 2022-09-04 22:22:18 +02:00
ca9843fa83 Merge pull request #2236 from kidonng/patch-1
Add `.mts` and `.cts` to TypeScript file extensions
2022-09-04 22:20:02 +02:00
Kid
d7b6519422 Add .mts and .cts to TypeScript file extensions
See also:

https://github.com/github/linguist/pull/5905
2022-09-04 22:06:54 +02:00
799bb1639c Try to fix all warnings 2022-09-04 21:30:14 +02:00
2dd2994b2f Merge remote-tracking branch 'origin/master' into feature/668/add-systemwide-config 2022-09-04 20:44:23 +02:00
49875d6ce7 Make bat::PrettyPrinter::syntaxes() iterate over new bat::Syntax struct (#2222)
We can't keep `syntect::parsing::SyntaxReference` as part of the public
API, because that might prevent us from bumping to syntect 6.0.0 without
also bumping bat to v2.0.0, once we reach v1.0.0.

So introduce a new stripped down struct `Syntax` and return that
instead. Let it be fully owned to make the API simple. It is not going
to be in a hot code path anyway.

I have looked at all code of our 27 dependents but I can't find a single
instance of this method being used, so this change should be safe for
v1.0.0.
2022-09-03 12:33:38 +02:00
899fdbb347 Remove code that tries to handle ANSI escape inputs (#2189)
Syntax highlighting is broken when input contains ANSI escape characters
anyway, so there is not much point in trying to handle ANSI escapes in
input.
2022-08-29 18:49:29 +02:00
621ab6078f CI: Check MSRV without git feature enabled
git2-rs MSRV policy is to only support latest stable rust (see
https://github.com/rust-lang/git2-rs#rust-version-requirements), so it
does not make sense to run our MSRV tests with git enabled.
2022-08-25 19:27:55 +02:00