Skip to content

Commit

Permalink
add nushell for #304
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Dec 14, 2021
1 parent d0f5674 commit 51c65c5
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 17 deletions.
1 change: 1 addition & 0 deletions LANGUAGES.md
Expand Up @@ -151,6 +151,7 @@ MUMPS (mps)
Mustache (mustache)
Nim (nim)
Nix (nix)
Nushell (nu)
nuspec (nuspec)
Objective C (m)
Objective C++ (mm)
Expand Down
39 changes: 24 additions & 15 deletions SCC-OUTPUT-REPORT.html
Expand Up @@ -17,7 +17,7 @@
<th>421</th>
<th>7033</th>
<th>1416</th>
<th>349702</th>
<th>350282</th>
</tr><tr>
<th>Java</th>
<th>24</th>
Expand All @@ -39,12 +39,12 @@
</tr><tr>
<th>Markdown</th>
<th>11</th>
<th>1338</th>
<th>1339</th>
<th>319</th>
<th>0</th>
<th>1019</th>
<th>1020</th>
<th>0</th>
<th>54198</th>
<th>54211</th>
</tr><tr>
<th>Python</th>
<th>10</th>
Expand Down Expand Up @@ -98,7 +98,7 @@
<th>85</th>
<th>855</th>
<th>95</th>
<th>38992</th>
<th>39003</th>
</tr><tr>
<th>C#</th>
<th>2</th>
Expand Down Expand Up @@ -381,12 +381,12 @@
</tr><tr>
<th>JSON</th>
<th>1</th>
<th>7372</th>
<th>7404</th>
<th>0</th>
<th>0</th>
<th>7372</th>
<th>7404</th>
<th>0</th>
<th>102679</th>
<th>103115</th>
</tr><tr>
<th>Korn Shell</th>
<th>1</th>
Expand Down Expand Up @@ -432,6 +432,15 @@
<th>62</th>
<th>12</th>
<th>1764</th>
</tr><tr>
<th>Nushell</th>
<th>1</th>
<th>22</th>
<th>2</th>
<th>2</th>
<th>18</th>
<th>2</th>
<th>514</th>
</tr><tr>
<th>Perl</th>
<th>1</th>
Expand Down Expand Up @@ -579,12 +588,12 @@
</tr></tbody>
<tfoot><tr>
<th>Total</th>
<th>172</th>
<th>26395</th>
<th>3001</th>
<th>1748</th>
<th>21646</th>
<th>2363</th>
<th>1799304</th>
<th>173</th>
<th>26450</th>
<th>3003</th>
<th>1750</th>
<th>21697</th>
<th>2365</th>
<th>1800858</th>
</tr></tfoot>
</table></body></html>
22 changes: 22 additions & 0 deletions examples/language/docker.nu
@@ -0,0 +1,22 @@
# docker wrapper that returns a nushell table
def docker [
...args:string # command to be passed to the real docker command
] {
let data = (^docker $args --format={{json .}}|lines|each {$it|from json})
if Labels in ($data|get) {
$data|docker labels
} {
$data
}

}

# subcommand used to reformat docker labels into their own table
def 'docker labels' [] {
update Labels {
get Labels|
split row ','|
where ($it|str starts-with ' ') == $false|
split column '=' name value
}
}
32 changes: 32 additions & 0 deletions languages.json
Expand Up @@ -5652,6 +5652,38 @@
"sh"
]
},
"Nushell": {
"complexitychecks": [
"for ",
"do { ",
"each {",
"if ",
"|| ",
"&& ",
"!= ",
"== "
],
"extensions": [
"nu"
],
"line_comment": [
"#"
],
"multi_line": [],
"quotes": [
{
"end": "\"",
"start": "\""
},
{
"end": "'",
"start": "'"
}
],
"shebangs": [
"nu"
]
},
"Smarty Template": {
"complexitychecks": [
"for ",
Expand Down
2 changes: 1 addition & 1 deletion processor/constants.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test-all.sh
Expand Up @@ -836,7 +836,7 @@ else
fi

# Try out specific languages
for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM '
for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM ' 'Nushell '
do
if ./scc "examples/language/" | grep -q "$i "; then
echo -e "${GREEN}PASSED $i Language Check"
Expand Down

0 comments on commit 51c65c5

Please sign in to comment.