Merge branch 'master' into syslog

This commit is contained in:
David Peter 2021-05-12 11:34:35 +02:00 committed by GitHub
commit 5db3c93057
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 232 additions and 56 deletions

18
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: monthly
time: "04:00"
timezone: Europe/Berlin
ignore:
- dependency-name: git2
versions:
- 0.13.17
- package-ecosystem: gitsubmodule
directory: "/"
schedule:
interval: monthly
time: "04:00"
timezone: Europe/Berlin

View file

@ -79,6 +79,13 @@ jobs:
run: bat --list-languages run: bat --list-languages
- name: List of themes - name: List of themes
run: bat --list-themes run: bat --list-themes
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --document-private-items --all-features
build: build:
name: ${{ matrix.job.os }} (${{ matrix.job.target }}) name: ${{ matrix.job.os }} (${{ matrix.job.target }})

3
.gitmodules vendored
View file

@ -61,9 +61,6 @@
[submodule "assets/syntaxes/Puppet"] [submodule "assets/syntaxes/Puppet"]
path = assets/syntaxes/02_Extra/Puppet path = assets/syntaxes/02_Extra/Puppet
url = https://github.com/russCloak/SublimePuppet url = https://github.com/russCloak/SublimePuppet
[submodule "assets/syntaxes/CSV"]
path = assets/syntaxes/02_Extra/CSV
url = https://github.com/wadetb/Sublime-Text-Advanced-CSV
[submodule "assets/themes/onehalf"] [submodule "assets/themes/onehalf"]
path = assets/themes/onehalf path = assets/themes/onehalf
url = https://github.com/sonph/onehalf url = https://github.com/sonph/onehalf

View file

@ -8,11 +8,13 @@
## Other ## Other
- `Input::ordinary_file` and `Input::with_name` now accept `Path` rather than `OsStr` see #1571 (@matklad) - `Input::ordinary_file` and `Input::with_name` now accept `Path` rather than `OsStr` see #1571 (@matklad)
- The `LESS` environment variable is now included in `bat --diagnostic`, see #1589 (@Enselic)
- Increased min. required Rust version to 1.45 - Increased min. required Rust version to 1.45
## Syntaxes ## Syntaxes
- Improved the Syslog syntax highlighting, see #1606 (@keith-hall) - Improved the Syslog syntax highlighting, see #1606 (@keith-hall)
- Replaced "Advanced CSV" with a custom CSV syntax definition written especially for `bat`; see #1574 (@keith-hall)
## New themes ## New themes

4
Cargo.lock generated
View file

@ -226,9 +226,9 @@ dependencies = [
[[package]] [[package]]
name = "console" name = "console"
version = "0.14.0" version = "0.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cc80946b3480f421c2f17ed1cb841753a371c7c5104f51d507e13f532c856aa" checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45"
dependencies = [ dependencies = [
"encode_unicode", "encode_unicode",
"lazy_static", "lazy_static",

View file

@ -36,7 +36,7 @@ regex-fancy = ["syntect/regex-fancy"] # Use the rust-only "fancy-regex" engine
atty = { version = "0.2.14", optional = true } atty = { version = "0.2.14", optional = true }
ansi_term = "^0.12.1" ansi_term = "^0.12.1"
ansi_colours = "^1.0" ansi_colours = "^1.0"
console = "0.14.0" console = "0.14.1"
lazy_static = { version = "1.4", optional = true } lazy_static = { version = "1.4", optional = true }
wild = { version = "2.0", optional = true } wild = { version = "2.0", optional = true }
content_inspector = "0.2.4" content_inspector = "0.2.4"

View file

@ -7,7 +7,7 @@ index 9c2aa3e..180cbbf 100644
<string>JSON String</string> <string>JSON String</string>
<key>scope</key> <key>scope</key>
- <string>meta.structure.dictionary.json string.quoted.double.json</string> - <string>meta.structure.dictionary.json string.quoted.double.json</string>
+ <string>meta.mapping.key.json string.quoted.double.json</string> + <string>meta.mapping.key.json string.quoted.double.json, punctuation.separator.sequence.csv</string>
<key>settings</key> <key>settings</key>
<dict> <dict>
<key>foreground</key> <key>foreground</key>

@ -1 +0,0 @@
Subproject commit 4786d037a761bc45e516f6b0624a839919ec6d05

View file

@ -1,46 +1,78 @@
%YAML 1.2 %YAML 1.2
--- ---
# http://www.sublimetext.com/docs/3/syntax.html # See http://www.sublimetext.com/docs/3/syntax.html
name: Advanced CSV name: Comma Separated Values
file_extensions: file_extensions:
- csv - csv
- tsv - tsv
scope: text.advanced_csv scope: text.csv
variables:
field_separator: (?:[,;\t])
record_separator: (?:$\n?)
contexts: contexts:
prototype:
- match: (?={{record_separator}})
pop: true
fields:
- match: ''
push:
- field_or_record_separator
- field4
- field_or_record_separator
- field3
- field_or_record_separator
- field2
- field_or_record_separator
- field1
main: main:
- match: (\") - meta_include_prototype: false
captures: - match: '^'
1: string.quoted.double.advanced_csv set: fields
push:
- meta_scope: meta.quoted.advanced_csv field_or_record_separator:
- match: (\") - meta_include_prototype: false
captures: - match: '{{record_separator}}'
1: string.quoted.double.advanced_csv scope: punctuation.terminator.record.csv
pop: true pop: true
- include: main - match: '{{field_separator}}'
- match: '(\[([+-]?\d*)(\:)?([+-]?\d*)(\,)?([+-]?\d*)(\:)?([+-]?\d*)\])?\s*([<>v^])?\s*(=)' scope: punctuation.separator.sequence.csv
captures: pop: true
1: keyword.operator.advanced_csv
2: constant.numeric.formula.advanced_csv field_contents:
4: constant.numeric.formula.advanced_csv - match: '"'
6: constant.numeric.formula.advanced_csv scope: punctuation.definition.string.begin.csv
8: constant.numeric.formula.advanced_csv push: double_quoted_string
9: keyword.operator.advanced_csv
10: keyword.operator.advanced_csv - match: (?={{field_separator}}|{{record_separator}})
push: pop: true
- meta_scope: meta.range.advanced_csv
- match: (?=(\")|$) double_quoted_string:
pop: true - meta_include_prototype: false
- include: scope:source.python - meta_scope: string.quoted.double.csv
- match: '(?<=^|,|\s|\")([0-9.eE+-]+)(?=$|,|\s|\")' - match: '""'
scope: meta.number.advanced_csv scope: constant.character.escape.csv
captures: - match: '"'
1: constant.numeric.advanced_csv scope: punctuation.definition.string.end.csv
- match: '(?<=^|,|\s|\")([^, \t\"]+)(?=$|,|\s|\")' pop: true
scope: meta.nonnumber.advanced_csv
captures: field1:
1: storage.type.advanced_csv - match: ''
- match: (\,) set:
scope: meta.delimiter.advanced_csv - meta_content_scope: meta.field-1.csv support.type
captures: - include: field_contents
1: keyword.operator.advanced_csv field2:
- match: ''
set:
- meta_content_scope: meta.field-2.csv support.function
- include: field_contents
field3:
- match: ''
set:
- meta_content_scope: meta.field-3.csv constant.numeric
- include: field_contents
field4:
- match: ''
set:
- meta_content_scope: meta.field-4.csv keyword.operator
- include: field_contents

@ -1 +1 @@
Subproject commit 45a1b6fe6cc37a2b614ae199d85c702b8711e22a Subproject commit cc13e7d4ef74a6556af09d8858d2cc6a47ef5451

@ -1 +1 @@
Subproject commit 4868322030c3644d6b8cfff68c85849789d9bdb2 Subproject commit 63819a1ab6b2075360933b2cfe41b416de0e3c26

View file

@ -0,0 +1,60 @@
# SYNTAX TEST "CSV.sublime-syntax"
Forename,Surname,House No.,Street,City,Postcode
#^^^^^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^^^^^ meta.field-2
# ^ punctuation.separator.sequence
# ^^^^^^^^^ meta.field-3
# ^ punctuation.separator.sequence
# ^^^^^^ meta.field-4
# ^ punctuation.separator.sequence
# ^^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^^^^^^ meta.field-2
John,Doe,87,Logon Road,Citiville,TU43 6GH
#^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^ meta.field-2
# ^ punctuation.separator.sequence
# ^^ meta.field-3
# ^ punctuation.separator.sequence
# ^^^^^^^^^^ meta.field-4
# ^ punctuation.separator.sequence
# ^^^^^^^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^^^^^^ meta.field-2
Jane,Doe,22,"""Fun"" Street","The City, County",FA90 1XA
#^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^ meta.field-2
# ^ punctuation.separator.sequence
# ^^ meta.field-3
# ^ punctuation.separator.sequence
# ^^^^^^^^^^^^^^^^ meta.field-4 string.quoted.double
# ^^ constant.character.escape
# ^^ constant.character.escape
# ^ punctuation.separator.sequence
# ^ meta.field-1 string.quoted.double punctuation.definition.string.begin
# ^^^^^^^^^^^^^^^^^ meta.field-1 string.quoted.double
# ^ meta.field-1 string.quoted.double punctuation.definition.string.end
# ^ punctuation.separator.sequence
# ^^^^^^^^ meta.field-2
Fred,Bloggs,"19","Street
#^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^^^^ meta.field-2
# ^ punctuation.separator.sequence
# ^^^ meta.field-3 string.quoted.double
# ^ punctuation.separator.sequence
# ^ meta.field-4 punctuation.definition.string.begin
# ^^^^^^^^ meta.field-4 string.quoted.double
Spanning Multiple ""
#^^^^^^^^^^^^^^^^^^^^ meta.field-4 string.quoted.double
# ^^ constant.character.escape
Lines",Citee,P0stc0d3
#^^^^^ meta.field-4 string.quoted.double
# ^ meta.field-4 punctuation.definition.string.end
# ^ punctuation.separator.sequence
# ^^^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^^^^^^ meta.field-2
Can't render this file because it contains an unexpected character in line 1 and column 15.

View file

@ -0,0 +1,60 @@
# SYNTAX TEST "CSV.sublime-syntax"
Forename Surname House No. Street City Postcode
#^^^^^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^^^^^ meta.field-2
# ^ punctuation.separator.sequence
# ^^^^^^^^^ meta.field-3
# ^ punctuation.separator.sequence
# ^^^^^^ meta.field-4
# ^ punctuation.separator.sequence
# ^^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^^^^^^ meta.field-2
John Doe 87 Logon Road Citiville TU43 6GH
#^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^ meta.field-2
# ^ punctuation.separator.sequence
# ^^ meta.field-3
# ^ punctuation.separator.sequence
# ^^^^^^^^^^ meta.field-4
# ^ punctuation.separator.sequence
# ^^^^^^^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^^^^^^ meta.field-2
Jane Doe 22 """Fun"" Street" "The City County" FA90 1XA
#^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^ meta.field-2
# ^ punctuation.separator.sequence
# ^^ meta.field-3
# ^ punctuation.separator.sequence
# ^^^^^^^^^^^^^^^^ meta.field-4 string.quoted.double
# ^^ constant.character.escape
# ^^ constant.character.escape
# ^ punctuation.separator.sequence
# ^ meta.field-1 string.quoted.double punctuation.definition.string.begin
# ^^^^^^^^^^^^^^^^^ meta.field-1 string.quoted.double
# ^ meta.field-1 string.quoted.double punctuation.definition.string.end
# ^ punctuation.separator.sequence
# ^^^^^^^^ meta.field-2
Fred Bloggs "19" "Street
#^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^^^^ meta.field-2
# ^ punctuation.separator.sequence
# ^^^ meta.field-3 string.quoted.double
# ^ punctuation.separator.sequence
# ^ meta.field-4 punctuation.definition.string.begin
# ^^^^^^^^ meta.field-4 string.quoted.double
Spanning Multiple ""
#^^^^^^^^^^^^^^^^^^^^ meta.field-4 string.quoted.double
# ^^ constant.character.escape
Lines" Citee P0stc0d3
#^^^^^ meta.field-4 string.quoted.double
# ^ meta.field-4 punctuation.definition.string.end
# ^ punctuation.separator.sequence
# ^^^^^ meta.field-1
# ^ punctuation.separator.sequence
# ^^^^^^^^ meta.field-2
Can't render this file because it contains an unexpected character in line 1 and column 15.

View file

@ -238,6 +238,7 @@ fn run() -> Result<bool> {
.info(EnvironmentVariables::list(&[ .info(EnvironmentVariables::list(&[
"SHELL", "SHELL",
"PAGER", "PAGER",
"LESS",
"BAT_PAGER", "BAT_PAGER",
"BAT_CACHE_PATH", "BAT_CACHE_PATH",
"BAT_CONFIG_PATH", "BAT_CONFIG_PATH",

View file

@ -1,7 +1,7 @@
first,last,address,city,zip first,last,address,city,zip
John,Doe,120 any st.,"Anytown, WW",08123 John,Doe,120 any st.,"Anytown, WW",08123
a,b a,b
1,"ha  1,"ha 
""ha""  ""ha"" 
ha",120 any st.,"Anytown, WW",08123 ha",120 any st.,"Anytown, WW",08123
3,4,120 any st.,"Anytown, WW",08123 3,4,120 any st.,"Anytown, WW",08123

Can't render this file because it contains an unexpected character in line 2 and column 276.