diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 5ff77927..19d4e927 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -58,6 +58,11 @@ jobs: with: command: test args: --release + - name: Run ignored-by-default unit tests with new syntaxes and themes + uses: actions-rs/cargo@v1 + with: + command: test + args: --release -- --ignored - name: Syntax highlighting regression test run: tests/syntax-tests/regression_test.sh - name: List of languages diff --git a/.gitmodules b/.gitmodules index e00573c6..4981c20e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -200,3 +200,9 @@ [submodule "assets/syntaxes/02_Extra/Ninja"] path = assets/syntaxes/02_Extra/Ninja url = https://github.com/pope/SublimeNinja.git +[submodule "assets/syntaxes/02_Extra/Svelte"] + path = assets/syntaxes/02_Extra/Svelte + url = https://github.com/corneliusio/svelte-sublime +[submodule "assets/themes/Coldark"] + path = assets/themes/Coldark + url = https://github.com/ArmandPhilippot/coldark-bat.git \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0971c859..478324c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,5 @@ # unreleased -- Add Note to refer to see detailed help with --help (and vice versa with -h). see #1215 (@henil) ## Features @@ -8,14 +7,22 @@ ## Bugfixes +- Throws an error when `bat` is being used as `pager`, see #1343 (@adrian-rivera) + ## Other +- Add note to refer to see detailed help with `--help` (and vice versa with `-h`), see #1215 (@henil) +- Add a `Contributors` section to `README`, see #1348 (@adrian-rivera) + ## Syntaxes - Manpage syntax highlighting has been improved, see #1315 (@keith-hall) +- Add Svelte file syntax, see #1285 (@kjmph) ## New themes +- Coldark, see #1329 (@armandphilippot) + ## `bat` as a library ## Packaging diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..dca1d0f3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,48 @@ +# Contributing + +Thank you for considering to contribute to `bat`! + + + +## Add an entry to the changelog + +If your contribution changes the behavior of `bat` (as opposed to a typo-fix +in the documentation), please update the [`CHANGELOG.md`](CHANGELOG.md) file +and describe your changes. This makes the release proess much easier and +therefore helps to get your changes into a new `bat` release faster. + +The top of the `CHANGELOG` contains a *"unreleased"* section with a few +subsections (Features, Bugfixes, …). Please add your entry to the subsection +that best describes your change + +Entries follow this format: +``` +- Short description of what has been changed, see #123 (@user) +``` +Here, `#123` is the number of the original issue and/or your pull request. +Please replace `@user` by your GitHub username. + + +## Development + +Please check out the [Development](https://github.com/sharkdp/bat#development) +section in the README. + + +## Adding a new feature + +Please consider opening a +[feature request ticket](https://github.com/sharkdp/bat/issues/new?assignees=&labels=feature-request&template=feature_request.md) +first in order to give us a chance to discuss the feature first. + + +## Adding new syntaxes/languages or themes + +Before you make a pull request that adds a new syntax or theme, please read +the [Customization](https://github.com/sharkdp/bat#customization) section +in the README first. + +If you really think that a particular syntax or theme should be added for all +users, please read the corresponding +[documentation](https://github.com/sharkdp/bat/blob/master/doc/assets.md) +first. diff --git a/README.md b/README.md index b2f7e74f..f04e6a1c 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,18 @@ highlighting: git show v0.6.0:src/main.rs | bat -l rs ``` -Note that syntax highlighting within diffs is currently not supported. If you are looking for this, check out [`delta`](https://github.com/dandavison/delta). +#### `git diff` + +You can combine `bat` with `git diff` to view lines around code changes with proper syntax +highlighting: +```bash +batdiff() { + git diff --name-only --diff-filter=d | xargs bat --diff +} +``` +If you prefer to use this as a separate tool, check out `batdiff` in [`bat-extras`](https://github.com/eth-p/bat-extras). + +If you are looking for more support for git and diff operations, check out [`delta`](https://github.com/dandavison/delta). #### `xclip` @@ -665,6 +676,10 @@ bash assets/create.sh cargo install --path . --locked --force ``` +## Contributing + +Take a look at the [`CONTRIBUTING.md`](CONTRIBUTING.md) guide. + ## Maintainers - [sharkdp](https://github.com/sharkdp) diff --git a/assets/syntaxes/02_Extra/Manpage.sublime-syntax b/assets/syntaxes/02_Extra/Manpage.sublime-syntax index ea0bcb3c..d92eea22 100644 --- a/assets/syntaxes/02_Extra/Manpage.sublime-syntax +++ b/assets/syntaxes/02_Extra/Manpage.sublime-syntax @@ -34,11 +34,11 @@ contexts: scope: markup.heading.title.man - match: \s\s pop: true - - match: '(?=\S)' + - match: '(?=\S|$)' pop: true - match: '$' - push: body + set: body body: # English, ..., ..., ..., Russian, ... @@ -48,14 +48,16 @@ contexts: embed: synopsis escape: '(?={{section_heading}})' + - match: '^(?:USAGE)' + scope: markup.heading.synopsis.man + embed: synopsis + escape: '(?={{section_heading}})' - match: '{{section_heading}}' scope: markup.heading.other.man embed: options # some man pages put command line options under the description heading escape: '(?={{section_heading}})' - - include: function-call - function-call: - match: '\b([A-Za-z0-9_\-]+)(\()([^)]*)(\))' captures: @@ -83,6 +85,7 @@ contexts: - match: '' pop: true - include: function-call + - include: c-code expect-command-line-option: - match: '[A-Za-z0-9-]+' @@ -127,9 +130,15 @@ contexts: - match: '$|(?=[],]|{{command_line_option}})' pop: true + c-code: + - match: '^(?=\s+(?:#include\b|#define\b|/\*|struct\s+(\w+\s*)?\{))' + embed: scope:source.c + #embed_scope: source.c.embedded.man + #escape: ^(?!#|\1|\s*(?:$|/\*|#include\b|#define\b)) + escape: ^(?=\s*(?:\(.*\.\)\s*$|[A-Z](?![A-Z]))) + synopsis: - - match: '^(?=\s+(?:#include|/\*))' - push: scope:source.c + - include: c-code - match: \[ scope: punctuation.section.brackets.begin.man push: command-line-option-or-pipe @@ -140,6 +149,7 @@ contexts: captures: 1: keyword.operator.logical.man #- match: (?={{command_line_option}}) + - match: \w+-\w+ - match: (?=-) push: - match: (?=\s*\|) diff --git a/assets/syntaxes/02_Extra/Svelte b/assets/syntaxes/02_Extra/Svelte new file mode 160000 index 00000000..bf92f5b7 --- /dev/null +++ b/assets/syntaxes/02_Extra/Svelte @@ -0,0 +1 @@ +Subproject commit bf92f5b7b69c8ea641d6822fd6d12cc2d9341956 diff --git a/assets/syntaxes/02_Extra/syntax_test_man.man b/assets/syntaxes/02_Extra/syntax_test_man.man index a4c8f91d..ee8bada3 100644 --- a/assets/syntaxes/02_Extra/syntax_test_man.man +++ b/assets/syntaxes/02_Extra/syntax_test_man.man @@ -5,7 +5,7 @@ SOMETHING(8) System Manager's Manual SOMETHING(8) # ^^^^^^^ meta.preprocessor NAME -#^^^ markup.heading.title +#^^^ markup.heading.other example - do something useful SYNOPSIS @@ -45,9 +45,16 @@ SYNOPSIS [--quiet] [--debug] [--help|-h] [--version] [--conf FILE] /* According to POSIX.1-2001, POSIX.1-2008 */ -# ^^ source comment.block punctuation.definition.comment +# ^^ source.c comment.block punctuation.definition.comment #include -# ^^^^^^^^ source meta.preprocessor.include keyword.control.import.include +# ^^^^^^^^ source.c meta.preprocessor.include keyword.control.import.include + struct timeval { +# ^^^^^^ source.c storage.type + + time_t tv_sec; /* seconds */ + suseconds_t tv_usec; /* microseconds */ + }; + DESCRIPTION @@ -123,3 +130,22 @@ OPTIONS # ^^^ variable.parameter # ^^ - variable output NUM (default 3) lines of copied context + +EXAMPLE + #include +# ^^^^^^^^ source.c meta.preprocessor.include keyword.control.import.include + + (This is not C code.) +# ^^^^^^^^^^^^^^^^^^^^^^ - source.c + + struct timeval { + time_t tv_sec; /* seconds */ + suseconds_t tv_usec; /* microseconds */ + }; +# ^ source.c punctuation.terminator + + The corresponding argument for pselect() has the following type: +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - source.c + #define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN | + EPOLLHUP | EPOLLERR) +# ^ source.c meta.preprocessor.macro meta.group punctuation.section.group.end diff --git a/assets/themes.bin b/assets/themes.bin index b8683424..bc291724 100644 Binary files a/assets/themes.bin and b/assets/themes.bin differ diff --git a/assets/themes/Coldark b/assets/themes/Coldark new file mode 160000 index 00000000..b4a1c74d --- /dev/null +++ b/assets/themes/Coldark @@ -0,0 +1 @@ +Subproject commit b4a1c74d8d5bdd136ec530e5905b810272472545 diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 50c39371..eb6f75bc 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -205,6 +205,14 @@ pub fn list_themes(cfg: &Config) -> Result<()> { writeln!(stdout, "{}", theme)?; } } + writeln!( + stdout, + "Further themes can be installed to '{}', \ + 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() + )?; Ok(()) } diff --git a/src/error.rs b/src/error.rs index 2e73b85b..3e5b3711 100644 --- a/src/error.rs +++ b/src/error.rs @@ -20,6 +20,10 @@ error_chain! { description("unknown syntax"), display("unknown syntax: '{}'", name) } + InvalidPagerValueBat { + description("invalid value `bat` for pager property"), + display("Use of bat as a pager is disallowed in order to avoid infinite recursion problems") + } } } diff --git a/src/output.rs b/src/output.rs index b0d5974e..689371b9 100644 --- a/src/output.rs +++ b/src/output.rs @@ -85,10 +85,10 @@ impl OutputType { match pagerflags.split_first() { Some((pager_name, args)) => { - let mut pager_path = PathBuf::from(pager_name); + let pager_path = PathBuf::from(pager_name); if pager_path.file_stem() == Some(&OsString::from("bat")) { - pager_path = PathBuf::from("less"); + return Err(ErrorKind::InvalidPagerValueBat.into()); } let is_less = pager_path.file_stem() == Some(&OsString::from("less")); diff --git a/tests/assets.rs b/tests/assets.rs index 7ced769c..55b5399e 100644 --- a/tests/assets.rs +++ b/tests/assets.rs @@ -1,7 +1,9 @@ use bat::assets::HighlightingAssets; /// This test ensures that we are not accidentally removing themes due to submodule updates. +/// It is 'ignore'd by default because it requires themes.bin to be up-to-date. #[test] +#[ignore] fn all_themes_are_present() { let assets = HighlightingAssets::from_binary(); @@ -12,6 +14,8 @@ fn all_themes_are_present() { themes, vec![ "1337", + "Coldark-Cold", + "Coldark-Dark", "DarkNeon", "Dracula", "GitHub", diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index da0690ef..09ac8498 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -405,6 +405,16 @@ fn pager_disable() { .stdout(predicate::eq("hello world\n").normalize()); } +#[test] +fn pager_value_bat() { + bat() + .arg("--pager=bat") + .arg("--paging=always") + .arg("test.txt") + .assert() + .failure(); +} + #[test] fn alias_pager_disable() { bat() diff --git a/tests/syntax-tests/highlighted/D/test.d b/tests/syntax-tests/highlighted/D/test.d new file mode 100644 index 00000000..da347147 --- /dev/null +++ b/tests/syntax-tests/highlighted/D/test.d @@ -0,0 +1,44 @@ +// selective import +import std.stdio : writeln, writefln; +// non-selective import +import std.algorithm; + +/* a multiline comment +* +* this function is safe because it doesn't use pointer arithmetic +*/ +int the_ultimate_answer() @safe { + // assert1on + assert(1 != 2); + // now we can safely return our answer  + return 42; +} + +void main() +{ + // function call with string literal + writeln("Hello World!"); + + // an int array declaration + int[] arr1 = [1, 2, 3]; + // an immutable double + immutable double pi = 3.14; + // a mutable double + double d1 = pi; + // a pointer + double* dp1 = &d1; + // another pointer to the same thingy + auto a1 = &d1; + // a constant bool + const bool b1 = true; + if (b1) { + // another function call  + writefln("%s\n%s\n%s\n", arr1, d1, the_ultimate_answer()); + } + else if (!b1) { + writeln("this seems wrong"); + } + else { + writeln("I'm giving up, this is too crazy for me"); + } +} diff --git a/tests/syntax-tests/highlighted/EtcGroup/test.group b/tests/syntax-tests/highlighted/EtcGroup/test.group new file mode 100644 index 00000000..5049c80e --- /dev/null +++ b/tests/syntax-tests/highlighted/EtcGroup/test.group @@ -0,0 +1,67 @@ +root:x:0:root +sys:x:3:bin +mem:x:8: +ftp:x:11: +mail:x:12: +log:x:19: +smmsp:x:25: +proc:x:26:polkitd +games:x:50: +lock:x:54: +network:x:90: +floppy:x:94: +scanner:x:96: +power:x:98: +adm:x:999:daemon +wheel:x:998:username +kmem:x:997: +tty:x:5: +utmp:x:996: +audio:x:995:mpd,username +disk:x:994: +input:x:993: +kvm:x:992: +lp:x:991: +optical:x:990:username +render:x:989: +storage:x:988:username +uucp:x:987: +video:x:986:username +users:x:985: +systemd-journal:x:984: +rfkill:x:983: +bin:x:1:daemon +daemon:x:2:bin +http:x:33: +nobody:x:65534: +dbus:x:81: +systemd-journal-remote:x:982: +systemd-network:x:981: +systemd-resolve:x:980: +systemd-timesync:x:979: +systemd-coredump:x:978: +uuidd:x:68: +username:x:1000: +git:x:977: +avahi:x:976: +colord:x:975: +polkitd:x:102: +mpd:x:45: +rtkit:x:133: +transmission:x:169: +wireshark:x:150:username +lightdm:x:974: +geoclue:x:973: +usbmux:x:140: +dhcpcd:x:972: +brlapi:x:971: +gdm:x:120: +libvirt:x:970: +flatpak:x:969: +gluster:x:968: +rpc:x:32: +tor:x:43: +rslsync:x:967: +docker:x:966:username +sambashare:x:1002:username +named:x:40: diff --git a/tests/syntax-tests/highlighted/Git Attributes/example.gitattributes b/tests/syntax-tests/highlighted/Git Attributes/example.gitattributes new file mode 100644 index 00000000..178bc759 --- /dev/null +++ b/tests/syntax-tests/highlighted/Git Attributes/example.gitattributes @@ -0,0 +1,16 @@ +# +# Comment + +[attr]binary -diff -merge -text + +* text=auto +*.c diff=c +*.cc text diff=cpp +*.o binary +*.bat text eol=crlf +*.lock text -diff +*.*ignore text +*.patch -text + +.gitattributes linguist-language=gitattributes +.gitkeep export-ignore diff --git a/tests/syntax-tests/highlighted/Git Config/text.gitconfig b/tests/syntax-tests/highlighted/Git Config/text.gitconfig new file mode 100644 index 00000000..91f3b08c --- /dev/null +++ b/tests/syntax-tests/highlighted/Git Config/text.gitconfig @@ -0,0 +1,107 @@ +[alias] + br = branch + branch = branch -a + c = clone --recursive + ci = commit + cl = clone + co = checkout + contributors = shortlog --summary --numbered + lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' + remote = remote -v + st = status + tag = tag -l +[apply] + whitespace = fix +[color] + ui = true +[color "branch"] + current = yellow + local = yellow + remote = green +[color "diff"] + commit = yellow bold + frag = magenta bold + meta = yellow + new = green bold + old = red bold + whitespace = red reverse +[color "diff-highlight"] + newHighlight = green bold 22 + newNormal = green bold + oldHighlight = red bold 52 + oldNormal = red bold +[color "status"] + added = green + changed = yellow + untracked = cyan +[commit] + gpgsign = true +[core] + editor = /usr/bin/vim + # global exclude + excludesfile = /home/frank/.config/git/ignore + pager = delta + ; broken on old machines + untrackedCache = true +[credential] + helper = store +[delta] + features = line-numbers decorations + max-line-length = 1024 + whitespace-error-style = 22 reverse +[delta "decorations"] + commit-decoration-style = bold yellow box ul + file-decoration-style = none + file-style = bold yellow + syntax-theme = gruvbox +[diff] + submodule = diff + algorithm = histogram + renames = copies +[difftool] + prompt = false +[difftool "wrapper"] + binary = true + cmd = git-difftool-wrapper \"$LOCAL\" \"$REMOTE\" +[diff "pdfconv"] + textconv = pdftohtml -stdout +[fetch] + negotiationAlgorithm = skipping + parallel = 0 +[help] + autocorrect = 1 +[index] + version = 4 +[interactive] + diffFilter = delta --color-only +[merge] + log = true +[protocol] + version = 2 +[pull] + rebase = true +[push] + default = current + recurseSubmodules = on-demand +[rebase] + autoStash = true +[rerere] + autoUpdate = true + enabled = true +[sequence] + editor = interactive-rebase-tool +[submodule] + fetchJobs = 0 +[tag] + gpgSign = true + sort = -version:refname +[url "git@gist.github.com:"] + insteadOf = gist: + pushInsteadOf = https://gist.github.com/ +[url "git@github.com:"] + insteadOf = gh: + pushInsteadOf = https://github.com/ +[user] + email = f.nord@example.com + name = Frank Nord + signingkey = AAAAAAAAAAAAAAAA diff --git a/tests/syntax-tests/highlighted/Graphviz DOT/test_digraph.dot b/tests/syntax-tests/highlighted/Graphviz DOT/test_digraph.dot new file mode 100644 index 00000000..dddc1366 --- /dev/null +++ b/tests/syntax-tests/highlighted/Graphviz DOT/test_digraph.dot @@ -0,0 +1,41 @@ +digraph { + label = <Label <font color='red'><b>formating,<br/> test <font point-size='20'>is done<br/> here <i>now.>; + + node [shape=box] + rankdir=LR + margin=0.1 + a->b + + // http://www.graphviz.org/doc/info/colors.html + // note: style=filled! + node [shape=box colorscheme=paired12 style=filled] + margin=0.1 + a2[fillcolor=1] + b2[fillcolor=3] + a2->b2->x2 + + // http://www.graphviz.org/doc/info/colors.html + // note: style=filled! + node [shape=box colorscheme=paired12 style=filled] + rankdir=LR + margin=0.1 + c1[fillcolor=1] + c2[fillcolor=2] + c3[fillcolor=3] + c4[fillcolor=4] + c5[fillcolor=5] + c6[fillcolor=6] + c7[fillcolor=7] + c8[fillcolor=8] + c9[fillcolor=9] + c10[fillcolor=10] + c11[fillcolor=11] + c12[fillcolor=12] + c->{c1 c3 c5 c7 c9 c11} + c1->c2 + c3->c4 + c5->c6 + c7->c8 + c9->c10 + c11->c12 +} diff --git a/tests/syntax-tests/highlighted/Graphviz DOT/test_graph.dot b/tests/syntax-tests/highlighted/Graphviz DOT/test_graph.dot new file mode 100644 index 00000000..205c2981 --- /dev/null +++ b/tests/syntax-tests/highlighted/Graphviz DOT/test_graph.dot @@ -0,0 +1,3 @@ +graph { + a--b +} diff --git a/tests/syntax-tests/highlighted/MATLAB/test.matlab b/tests/syntax-tests/highlighted/MATLAB/test.matlab new file mode 100644 index 00000000..51c37f76 --- /dev/null +++ b/tests/syntax-tests/highlighted/MATLAB/test.matlab @@ -0,0 +1,34 @@ +function zz=sample(aa) +%%%%%%%%%%%%%%%%%% +% some comments +%%%%%%%%%%%%%%%%%% + +x = 'a string'; % some 'ticks' in a comment +y = 'a string with ''interal'' quotes'; + +for i=1:20 + disp(i); +end + +a = rand(30); +b = rand(30); + +c = a .* b ./ a \ ... comment at end of line and continuation + (b .* a + b - a); + +c = a' * b'; % note: these ticks are for transpose, not quotes. + +disp('a comment symbol, %, in a string'); + +!echo abc % this isn't a comment - it's passed to system command + +function y=myfunc(x) +y = exp(x); + +%{ + a block comment +%} + +function no_arg_func +fprintf('%s\n', 'function with no args') +end diff --git a/tests/syntax-tests/highlighted/Manpage/bat-0.16.man b/tests/syntax-tests/highlighted/Manpage/bat-0.16.man index 921fe261..92485f84 100644 --- a/tests/syntax-tests/highlighted/Manpage/bat-0.16.man +++ b/tests/syntax-tests/highlighted/Manpage/bat-0.16.man @@ -1,12 +1,12 @@ BAT(1) General Commands Manual BAT(1) NAME - bat - a cat(1) clone with syntax highlighting and Git integration. + bat - a cat(1) clone with syntax highlighting and Git integration. USAGE - bat [OPTIONS] [FILE]... + bat [OPTIONS] [FILE]... - bat cache [CACHE-OPTIONS] [--build|--clear] + bat cache [CACHE-OPTIONS] [--build|--clear] DESCRIPTION  bat prints the syntax-highlighted content of a collection of FILEs to diff --git a/tests/syntax-tests/highlighted/Manpage/select-2.man b/tests/syntax-tests/highlighted/Manpage/select-2.man index e01db209..a746c365 100644 --- a/tests/syntax-tests/highlighted/Manpage/select-2.man +++ b/tests/syntax-tests/highlighted/Manpage/select-2.man @@ -18,9 +18,9 @@  fd_set *exceptfds, const struct timespec *timeout,  const sigset_t *sigmask); - Feature Test Macro Requirements for glibc (see feature_test_macros(7)): + Feature Test Macro Requirements for glibc (see feature_test_macros(7)): - pselect(): _POSIX_C_SOURCE >= 200112L + pselect(): _POSIX_C_SOURCE >= 200112L DESCRIPTION  select() allows a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become @@ -142,17 +142,17 @@  The timeout  The timeout argument for select() is a structure of the following type: - struct timeval { - time_t tv_sec; /* seconds */ - suseconds_t tv_usec; /* microseconds */ - }; + struct timeval { + time_t tv_sec; /* seconds */ + suseconds_t tv_usec; /* microseconds */ + };  The corresponding argument for pselect() has the following type: - struct timespec { - time_t tv_sec; /* seconds */ - long tv_nsec; /* nanoseconds */ - }; + struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ + };  On Linux, select() modifies timeout to reflect the amount of time not slept; most other implementations do not do this.  (POSIX.1 permits either behavior.) This causes problems both when Linux code which reads timeout is ported to other operating @@ -213,14 +213,14 @@  Within the Linux kernel source, we find the following definitions which show the correspondence between the readable,  writable, and exceptional condition notifications of select() and the event notifications provided by poll(2) and epoll(7): - #define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN | - EPOLLHUP | EPOLLERR) - /* Ready for reading */ - #define POLLOUT_SET (EPOLLWRBAND | EPOLLWRNORM | EPOLLOUT | - EPOLLERR) - /* Ready for writing */ - #define POLLEX_SET (EPOLLPRI) - /* Exceptional condition */ + #define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN | + EPOLLHUP | EPOLLERR) + /* Ready for reading */ + #define POLLOUT_SET (EPOLLWRBAND | EPOLLWRNORM | EPOLLOUT | + EPOLLERR) + /* Ready for writing */ + #define POLLEX_SET (EPOLLPRI) + /* Exceptional condition */  Multithreaded applications  If a file descriptor being monitored by select() is closed in another thread, the result is unspecified. On some UNIX sys‐ @@ -242,11 +242,11 @@  The final argument of the pselect6() system call is not a sigset_t * pointer, but is instead a structure of the form: - struct { - const kernel_sigset_t *ss; /* Pointer to signal set */ - size_t ss_len; /* Size (in bytes) of object - pointed to by 'ss' */ - }; + struct { + const kernel_sigset_t *ss; /* Pointer to signal set */ + size_t ss_len; /* Size (in bytes) of object + pointed to by 'ss' */ + };  This allows the system call to obtain both a pointer to the signal set and its size, while allowing for the fact that most ar‐  chitectures support a maximum of 6 arguments to a system call. See sigprocmask(2) for a discussion of the difference between @@ -283,40 +283,40 @@  by internally copying the timeout to a local variable and passing that variable to the system call. EXAMPLES - #include  - #include  - #include  + #include <stdio.h> + #include <stdlib.h> + #include <sys/select.h> - int - main(void) - { - fd_set rfds; - struct timeval tv; - int retval; + int + main(void) + { + fd_set rfds; + struct timeval tv; + int retval; - /* Watch stdin (fd 0) to see when it has input. */ + /* Watch stdin (fd 0) to see when it has input. */ - FD_ZERO(&rfds); - FD_SET(0, &rfds); + FD_ZERO(&rfds); + FD_SET(0, &rfds); - /* Wait up to five seconds. */ + /* Wait up to five seconds. */ - tv.tv_sec = 5; - tv.tv_usec = 0; + tv.tv_sec = 5; + tv.tv_usec = 0; - retval = select(1, &rfds, NULL, NULL, &tv); - /* Don't rely on the value of tv now! */ + retval = select(1, &rfds, NULL, NULL, &tv); + /* Don't rely on the value of tv now! */ - if (retval == -1) - perror("select()"); - else if (retval) - printf("Data is available now.\n"); - /* FD_ISSET(0, &rfds) will be true. */ - else - printf("No data within five seconds.\n"); + if (retval == -1) + perror("select()"); + else if (retval) + printf("Data is available now.\n"); + /* FD_ISSET(0, &rfds) will be true. */ + else + printf("No data within five seconds.\n"); - exit(EXIT_SUCCESS); - } + exit(EXIT_SUCCESS); + } SEE ALSO  accept(2), connect(2), poll(2), read(2), recv(2), restart_syscall(2), send(2), sigprocmask(2), write(2), epoll(7), time(7) diff --git a/tests/syntax-tests/highlighted/PowerShell/test.ps1 b/tests/syntax-tests/highlighted/PowerShell/test.ps1 new file mode 100644 index 00000000..915b6072 --- /dev/null +++ b/tests/syntax-tests/highlighted/PowerShell/test.ps1 @@ -0,0 +1,25 @@ +# PowerShell script for testing syntax highlighting + +function Get-FutureTime { + param ( + [Int32] $Minutes + ) +  + $time = Get-Date | % { $_.AddMinutes($Minutes) } + "{0:d2}:{1:d2}:{2:d2}" -f @($time.hour, $time.minute, $time.second) +} + +if ($env:PATH -match '.*rust.*') { + 'Path contains Rust' + try { + & "cargo" "--version" + } catch { + Write-Error "Failed to run cargo" + } +} else { + 'Path does not contain Rust' +} + +(5..30) | ? { $_ % (2 * 2 + 1) -eq 0 } | % {"In {0} minutes, the time will be {1}." -f $_, $( Get-FutureTime $_ )} +$later = Get-FutureTime -Minutes $( Get-Random -Minimum 60 -Maximum 120 ) +"The time will be " + $later + " later." diff --git a/tests/syntax-tests/highlighted/QML/BatSyntaxTest.qml b/tests/syntax-tests/highlighted/QML/BatSyntaxTest.qml new file mode 100644 index 00000000..1d1ada1d --- /dev/null +++ b/tests/syntax-tests/highlighted/QML/BatSyntaxTest.qml @@ -0,0 +1,219 @@ +import QtQuick 2.0 +import "../components" + +Page { + id: page + + // properties + + property bool startup: true + readonly property var var1: null + readonly property QtObject var2: null + + allowedOrientations: Orientation.All + + /* components */ + + DBusServiceWatcher { + id: dbusService + service: "org.bat.service" + + onRegisteredChanged: { + if (dbusService.registered) { + announcedNameField.text = daemon.announcedName() + } + } + } + + Component.onCompleted: { + console.debug("completed") + } + + Flickable { + anchors.fill: parent + contentHeight: column.height + visible: dbusService.registered + + ViewPlaceholder { + enabled: !startup + && trustedDevices.count == 0 + && nearDevices.count == 0 + text: qsTr("Install Bat.") + } + + Column { + id: column + + width: page.width + spacing: Theme.paddingLarge + + PageHeader { + title: qsTr("Syntax Test") + } + + TextField { + id: announcedNameField + width: parent.width + label: qsTr("Device Name") + text: dbusService.registered ? daemon.announcedName() : "" + + onActiveFocusChanged: { + if (activeFocus) + return + + if (text.length === 0) { + text = daemon.announcedName() + } else { + daemon.setAnnouncedName(text) + placeholderText = text + } + } + + EnterKey.onClicked: announcedNameField.focus = false + EnterKey.iconSource: "image://theme/icon-m-enter-close" + } + + + Component { + id: deviceDelegate + + ListItem { + id: listItem + + property bool showStatus: deviceStatusLabel.text.length + + width: page.width + height: Theme.itemSizeMedium + + Image { + id: icon + source: iconUrl + + x: Theme.horizontalPageMargin + anchors.verticalCenter: parent.verticalCenter + sourceSize.width: Theme.iconSizeMedium + sourceSize.height: Theme.iconSizeMedium + } + + Label { + id: deviceNameLabel + anchors { + left: icon.right + leftMargin: Theme.paddingLarge + right: parent.right + rightMargin: Theme.horizontalPageMargin + } + y: listItem.contentHeight / 2 - implicitHeight / 2 + - showStatus * (deviceStatusLabel.implicitHeight / 2) + + text: name + color: listItem.highlighted + ? Theme.highlightColor + : Theme.primaryColor + truncationMode: TruncationMode.Fade + textFormat: Text.PlainText + + Behavior on y { NumberAnimation {} } + } + + Label { + id: deviceStatusLabel + anchors { + left: deviceNameLabel.left + top: deviceNameLabel.bottom + right: parent.right + rightMargin: Theme.horizontalPageMargin + } + + text: (trusted && reachable) + ? qsTr("Connected") + : (hasPairingRequests || waitsForPairing + ? qsTr("Pending pairing request ...") : "") + color: listItem.highlighted + ? Theme.secondaryHighlightColor + : Theme.secondaryColor + truncationMode: TruncationMode.Fade + font.pixelSize: Theme.fontSizeExtraSmall + opacity: showStatus ? 1.0 : 0.0 + width: parent.width + textFormat: Text.PlainText + + Behavior on opacity { FadeAnimation {} } + } + + onClicked: { + pageStack.push( + Qt.resolvedUrl("DevicePage.qml"), + { deviceId: id }) + } + } + } + + DeviceListModel { + id: devicelistModel + } + + ColumnView { + id: devicesView + width: page.width + itemHeight: Theme.itemSizeMedium + + + model: trustedDevicesModel + delegate: deviceDelegate + visible: devicesView.count > 0 + } + } + + PullDownMenu { +// MenuItem { +// text: qsTr("About ...") +// onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml")) +// } + + MenuItem { + text: qsTr("Settings ...") + onClicked: pageStack.push(Qt.resolvedUrl("SettingsPage.qml")) + } + } + + VerticalScrollDecorator {} + } + + /* + Connections { + target: ui + onOpeningDevicePage: openDevicePage(deviceId) + }*/ + + Timer { + interval: 1000 + running: true + repeat: false + onTriggered: startup = false + } + + function openDevicePage(deviceId) { + if (typeof pageStack === "undefined") + return; + + console.log("opening device " + deviceId) + + window.activate() + + var devicePage = pageStack.find(function(page) { + return page.objectName === "DevicePage" + }) + if (devicePage !== null && devicePage.deviceId === deviceId) { + pageStack.pop(devicePage) + ui.showMainWindow() + return + } + + pageStack.pop(page, PageStackAction.Immediate) + pageStack.push( + Qt.resolvedUrl("DevicePage.qml"), + { deviceId: deviceId }, + PageStackAction.Immediate) + } +} diff --git a/tests/syntax-tests/highlighted/SLS/test.sls b/tests/syntax-tests/highlighted/SLS/test.sls new file mode 100644 index 00000000..3e4c6386 --- /dev/null +++ b/tests/syntax-tests/highlighted/SLS/test.sls @@ -0,0 +1,57 @@ +required_packages: + pkg.installed: + - pkgs: + - git + - perl + - fortune + +cowsay_source: + git.latest: + - name: https://github.com/jasonm23/cowsay.git + - target: /root/cowsay + +run_installer: + cmd.run: + - name: ./install.sh /usr/local + - cwd: /root/cowsay + - onchanges: + - git: cowsay_source + +{% set cowfiles = salt.cmd.run('cowsay -l').split('\n')[1:] %} +{% set ascii_arts = cowfiles | join(' ') %} + +{% for ascii_art in ascii_arts.split(' ') %} +run_cowsay_{{ ascii_art }}: # name must be unique + cmd.run: + {% if ascii_art is in ['head-in', 'sodomized', 'telebears'] %} + - name: echo cowsay -f {{ ascii_art }} should not be used + {% else %} + - name: fortune | cowsay -f {{ ascii_art }} + {% endif %} +{% endfor %} + +echo_pillar_demo_1: + cmd.run: + - name: "echo {{ pillar.demo_text | default('pillar not defined') }}" + +echo_pillar_demo_2: + cmd.run: + - name: "echo {{ pillar.demo.text | default('pillar not defined') }}" + +# Comment +{% set rand = salt['random.get_str'](20) %} +{% set IP_Address = pillar['IP_Address'] %} + +wait: + cmd.run: + - name: sleep 210 # another comment + +create_roster_file: + file.managed: + - name: /tmp/salt-roster-{{ rand }} + - contents: + - 'switch:' + - ' host: {{ IP_Address }}' + - " user: test" + - " passwd: {{ passwd }}" + diff --git a/tests/syntax-tests/highlighted/Svelte/App.svelte b/tests/syntax-tests/highlighted/Svelte/App.svelte new file mode 100644 index 00000000..aff961d5 --- /dev/null +++ b/tests/syntax-tests/highlighted/Svelte/App.svelte @@ -0,0 +1,57 @@ +<script> + import { onMount } from 'svelte'; + import List from './List.svelte'; + import Item from './Item.svelte'; + + let item; + let page; + + async function hashchange() { + // the poor man's router! + const path = window.location.hash.slice(1); + + if (path.startsWith('/item')) { + const id = path.slice(6); + item = await fetch(`https://node-hnapi.herokuapp.com/item/${id}`).then(r => r.json()); + + window.scrollTo(0,0); + } else if (path.startsWith('/top')) { + page = +path.slice(5); + item = null; + } else { + window.location.hash = '/top/1'; + } + } + + onMount(hashchange); + + +<style> + main { + position: relative; + max-width: 800px; + margin: 0 auto; + min-height: 101vh; + padding: 1em; + } + + main :global(.meta) { + color: #999; + font-size: 12px; + margin: 0 0 1em 0; + } + + main :global(a) { + color: rgb(0,0,150); + } + + +<svelte:window on:hashchange={hashchange}/> + +<main> + {#if item} + <Item {item} returnTo="#/top/{page}"/> + {:else if page} + <List {page}/> + {/if} + diff --git a/tests/syntax-tests/highlighted/Vue/example.vue b/tests/syntax-tests/highlighted/Vue/example.vue new file mode 100644 index 00000000..d8da0852 --- /dev/null +++ b/tests/syntax-tests/highlighted/Vue/example.vue @@ -0,0 +1,55 @@ +<template> + <div id="app" class="container-fluid"> + <AppHeader> + <transition name="page" mode="out-in" v-if="!isLoading"> + <router-view> +  + <AppLoadingIndicator> +  + + +<script> +import AppHeader from "@/components/AppHeader"; +import AppLoadingIndicator from "@/components/AppLoadingIndicator"; +import { mapGetters } from "vuex"; + +export default { + name: "App", + components: { + AppHeader, + AppLoadingIndicator, + }, + beforeCreate() { + this.$store.dispatch("fetchData"); + }, + data: { + message: "Hello!" + }, + computed: { + ...mapGetters({ + isLoading: "isLoading", + }), + }, +}; + + +<style> +body { + background-color: rgba(72, 163, 184, 0.05) !important; +} + +.page-enter-active, +.page-leave-active { + transition: opacity 0.2s; +} + +.page-enter, +.page-leave-active { + opacity: 0; +} + +.page-enter:hover { + opacity: 1; +} + + diff --git a/tests/syntax-tests/highlighted/nginx/nginx.conf b/tests/syntax-tests/highlighted/nginx/nginx.conf new file mode 100644 index 00000000..4b2f9da9 --- /dev/null +++ b/tests/syntax-tests/highlighted/nginx/nginx.conf @@ -0,0 +1,140 @@ +#user nobody; +worker_processes 1; +#pid logs/nginx.pid; + +load_module "/usr/local/libexec/nginx/ngx_http_xslt_filter_module.so"; +load_module "/usr/local/libexec/nginx/ngx_rtmp_module.so"; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile  on; + keepalive_timeout 65; + gzip  on; + gzip_disable "msie6"; + + include /usr/local/etc/nginx/sites.d/*; +} + +rtmp { + server { + listen 1935; + max_message 10M; + + application wnob { + live on; + record off; + } + + application strim { + live on; + hls on; + + hls_path /usr/local/www/hls/; + + hls_variant _low BANDWIDTH=250000; + hls_variant _mid BANDWIDTH=500000; + hls_variant _high BANDWIDTH=1000000; + hls_variant _hd720 BANDWIDTH=1500000; + hls_variant _src BANDWIDTH=2000000; + } + } +} + +server { + listen 443 ssl; + server_name host.example.com + root /usr/local/www/host.example.com/; + error_page 404 /404.html; + + index index.html; + autoindex on; + autoindex_localtime off; + autoindex_format xml; + + location / { + xslt_stylesheet /usr/local/www/host.example.com/index.xslt; + } + + location ~ /\..* { + return 404; + } + + location ~ /.+/ { + xslt_stylesheet /usr/local/www/host.example.com/project.xslt; + } + + location ~ /.*\.xslt/ { + return 404; + } + + location ~ \.thumb\.png$ { + error_page 404 /404.thumb.png; + } + ssl_certificate /usr/local/etc/letsencrypt/live/host.example.com/fullchain.pem; # managed by Certbot + ssl_certificate_key /usr/local/etc/letsencrypt/live/host.example.com/privkey.pem; # managed by Certbot + + include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem; + + add_header Strict-Transport-Security "max-age=31536000" always; + +} + +server { + listen 80; + server_name host.example.com; + + if ($host = host.example.com) { + return 301 https://$host$request_uri; + } + + return 404; +} + +server { + listen 443 ssl; + server_name other.example.com; + + ssl_certificate /usr/local/etc/letsencrypt/live/other.example.com/fullchain.pem; + ssl_certificate_key /usr/local/etc/letsencrypt/live/other.example.com/privkey.pem; + + include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /usr/local/etc/letsencrypt/ssl-dhparams.pem; + + add_header Strict-Transport-Security "max-age=31536000" always; + + access_log /home/otherapp/logs/access.log; + error_log /home/otherapp/logs/error.log; + + client_max_body_size 5M; + + location / { + root /home/otherapp/app/static; + index man.txt; + try_files $uri @proxy; + } + + location @proxy { + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://unix:/var/run/otherapp/sock:; + } +} + +server { + listen 80; + server_name other.example.com; + + if ($host = other.example.com) { + return 301 https://$host$request_uri; + } + + return 404; +} diff --git a/tests/syntax-tests/highlighted/nix/test.nix b/tests/syntax-tests/highlighted/nix/test.nix new file mode 100644 index 00000000..bf86676a --- /dev/null +++ b/tests/syntax-tests/highlighted/nix/test.nix @@ -0,0 +1,15 @@ +{ nixpkgs ?  +, nixpkgs' ? import nixpkgs {}}: with nixpkgs'; + +# some comment +stdenv.mkDerivation rec { + pname = "test"; + version = "0.2.3"; + name = "${pname}-${version}"; + + buildInputs = [ + gzip + bzip2 + python27 + ]; +} diff --git a/tests/syntax-tests/highlighted/orgmode/test.org b/tests/syntax-tests/highlighted/orgmode/test.org new file mode 100644 index 00000000..82a9041f --- /dev/null +++ b/tests/syntax-tests/highlighted/orgmode/test.org @@ -0,0 +1,38 @@ +* This is header +** sub header +*** sub sub header +**** sub sub sub header + +* Table representation +| Name | Age | +|---------+-----| +| Milli | 23 | +| Vanilli | 22 | + +* Spreadsheets +| n | n + 2 | n ^ 2 | +|---+-------+-------| +| 1 | 3 | 1 | +| 2 | 4 | 4 | +| 3 | 5 | 9 | +#+TBLFM: $2=$1+2::$3=$1*$1 + +* Source Code + +#+BEGIN_SRC rust + # recursive fibonacci + fn fib(n: u32) -> u32 { + match n { + 0 | 1 => 1, + _ => fib(n - 1) + fib(n - 2), + } + } +#+END_SRC + +* ToDo and Checkboxes Example +** DONE Write source example +** TODO Generate highlighted example [1/3] + - [X] run update script + - [-] get code review + - [ ] merge into master + diff --git a/tests/syntax-tests/source/D/test.d b/tests/syntax-tests/source/D/test.d new file mode 100644 index 00000000..534132f5 --- /dev/null +++ b/tests/syntax-tests/source/D/test.d @@ -0,0 +1,44 @@ +// selective import +import std.stdio : writeln, writefln; +// non-selective import +import std.algorithm; + +/* a multiline comment +* +* this function is safe because it doesn't use pointer arithmetic +*/ +int the_ultimate_answer() @safe { + // assert1on + assert(1 != 2); + // now we can safely return our answer + return 42; +} + +void main() +{ + // function call with string literal + writeln("Hello World!"); + + // an int array declaration + int[] arr1 = [1, 2, 3]; + // an immutable double + immutable double pi = 3.14; + // a mutable double + double d1 = pi; + // a pointer + double* dp1 = &d1; + // another pointer to the same thingy + auto a1 = &d1; + // a constant bool + const bool b1 = true; + if (b1) { + // another function call + writefln("%s\n%s\n%s\n", arr1, d1, the_ultimate_answer()); + } + else if (!b1) { + writeln("this seems wrong"); + } + else { + writeln("I'm giving up, this is too crazy for me"); + } +} diff --git a/tests/syntax-tests/source/EtcGroup/test.group b/tests/syntax-tests/source/EtcGroup/test.group new file mode 100644 index 00000000..68331d73 --- /dev/null +++ b/tests/syntax-tests/source/EtcGroup/test.group @@ -0,0 +1,67 @@ +root:x:0:root +sys:x:3:bin +mem:x:8: +ftp:x:11: +mail:x:12: +log:x:19: +smmsp:x:25: +proc:x:26:polkitd +games:x:50: +lock:x:54: +network:x:90: +floppy:x:94: +scanner:x:96: +power:x:98: +adm:x:999:daemon +wheel:x:998:username +kmem:x:997: +tty:x:5: +utmp:x:996: +audio:x:995:mpd,username +disk:x:994: +input:x:993: +kvm:x:992: +lp:x:991: +optical:x:990:username +render:x:989: +storage:x:988:username +uucp:x:987: +video:x:986:username +users:x:985: +systemd-journal:x:984: +rfkill:x:983: +bin:x:1:daemon +daemon:x:2:bin +http:x:33: +nobody:x:65534: +dbus:x:81: +systemd-journal-remote:x:982: +systemd-network:x:981: +systemd-resolve:x:980: +systemd-timesync:x:979: +systemd-coredump:x:978: +uuidd:x:68: +username:x:1000: +git:x:977: +avahi:x:976: +colord:x:975: +polkitd:x:102: +mpd:x:45: +rtkit:x:133: +transmission:x:169: +wireshark:x:150:username +lightdm:x:974: +geoclue:x:973: +usbmux:x:140: +dhcpcd:x:972: +brlapi:x:971: +gdm:x:120: +libvirt:x:970: +flatpak:x:969: +gluster:x:968: +rpc:x:32: +tor:x:43: +rslsync:x:967: +docker:x:966:username +sambashare:x:1002:username +named:x:40: diff --git a/tests/syntax-tests/source/Git Attributes/example.gitattributes b/tests/syntax-tests/source/Git Attributes/example.gitattributes new file mode 100644 index 00000000..9b8e58b8 --- /dev/null +++ b/tests/syntax-tests/source/Git Attributes/example.gitattributes @@ -0,0 +1,16 @@ +# +# Comment + +[attr]binary -diff -merge -text + +* text=auto +*.c diff=c +*.cc text diff=cpp +*.o binary +*.bat text eol=crlf +*.lock text -diff +*.*ignore text +*.patch -text + +.gitattributes linguist-language=gitattributes +.gitkeep export-ignore \ No newline at end of file diff --git a/tests/syntax-tests/source/Git Config/LICENSE.md b/tests/syntax-tests/source/Git Config/LICENSE.md new file mode 100644 index 00000000..4d51ec63 --- /dev/null +++ b/tests/syntax-tests/source/Git Config/LICENSE.md @@ -0,0 +1 @@ +The `test.gitconfig` file has been added from https://github.com/sharkdp/bat/pull/1336#issuecomment-715905807. Its "free to use". \ No newline at end of file diff --git a/tests/syntax-tests/source/Git Config/text.gitconfig b/tests/syntax-tests/source/Git Config/text.gitconfig new file mode 100644 index 00000000..45de0fe5 --- /dev/null +++ b/tests/syntax-tests/source/Git Config/text.gitconfig @@ -0,0 +1,107 @@ +[alias] + br = branch + branch = branch -a + c = clone --recursive + ci = commit + cl = clone + co = checkout + contributors = shortlog --summary --numbered + lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' + remote = remote -v + st = status + tag = tag -l +[apply] + whitespace = fix +[color] + ui = true +[color "branch"] + current = yellow + local = yellow + remote = green +[color "diff"] + commit = yellow bold + frag = magenta bold + meta = yellow + new = green bold + old = red bold + whitespace = red reverse +[color "diff-highlight"] + newHighlight = green bold 22 + newNormal = green bold + oldHighlight = red bold 52 + oldNormal = red bold +[color "status"] + added = green + changed = yellow + untracked = cyan +[commit] + gpgsign = true +[core] + editor = /usr/bin/vim + # global exclude + excludesfile = /home/frank/.config/git/ignore + pager = delta + ; broken on old machines + untrackedCache = true +[credential] + helper = store +[delta] + features = line-numbers decorations + max-line-length = 1024 + whitespace-error-style = 22 reverse +[delta "decorations"] + commit-decoration-style = bold yellow box ul + file-decoration-style = none + file-style = bold yellow + syntax-theme = gruvbox +[diff] + submodule = diff + algorithm = histogram + renames = copies +[difftool] + prompt = false +[difftool "wrapper"] + binary = true + cmd = git-difftool-wrapper \"$LOCAL\" \"$REMOTE\" +[diff "pdfconv"] + textconv = pdftohtml -stdout +[fetch] + negotiationAlgorithm = skipping + parallel = 0 +[help] + autocorrect = 1 +[index] + version = 4 +[interactive] + diffFilter = delta --color-only +[merge] + log = true +[protocol] + version = 2 +[pull] + rebase = true +[push] + default = current + recurseSubmodules = on-demand +[rebase] + autoStash = true +[rerere] + autoUpdate = true + enabled = true +[sequence] + editor = interactive-rebase-tool +[submodule] + fetchJobs = 0 +[tag] + gpgSign = true + sort = -version:refname +[url "git@gist.github.com:"] + insteadOf = gist: + pushInsteadOf = https://gist.github.com/ +[url "git@github.com:"] + insteadOf = gh: + pushInsteadOf = https://github.com/ +[user] + email = f.nord@example.com + name = Frank Nord + signingkey = AAAAAAAAAAAAAAAA \ No newline at end of file diff --git a/tests/syntax-tests/source/Graphviz DOT/LICENSE.md b/tests/syntax-tests/source/Graphviz DOT/LICENSE.md new file mode 100644 index 00000000..3f166cbe --- /dev/null +++ b/tests/syntax-tests/source/Graphviz DOT/LICENSE.md @@ -0,0 +1,22 @@ +The files `test_digraph.dot` and `test_graph.dot` are modified versions the files from https://github.com/scriptum/graphviz-examples/tree/a7762875efa32f90f6f1a37d866b2c26d362202a under the following license: + +The MIT License (MIT) + +Copyright (c) 2014 Pavel Roschin + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/syntax-tests/source/Graphviz DOT/test_digraph.dot b/tests/syntax-tests/source/Graphviz DOT/test_digraph.dot new file mode 100644 index 00000000..11e383b4 --- /dev/null +++ b/tests/syntax-tests/source/Graphviz DOT/test_digraph.dot @@ -0,0 +1,41 @@ +digraph { + label =