Skip to content

Commit 73f9e8c

Browse files
committed
add support for Justfile, #923
1 parent 251e7a1 commit 73f9e8c

File tree

5 files changed

+72
-3
lines changed

5 files changed

+72
-3
lines changed

Unix/cloc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9153,6 +9153,7 @@ sub set_constants { # {{{1
91539153
'jsp' => 'JSP' , # Java server pages
91549154
'jspf' => 'JSP' , # Java server pages
91559155
'junos' => 'Juniper Junos' ,
9156+
'just' => 'Justfile' ,
91569157
'vm' => 'Velocity Template Language' ,
91579158
'kv' => 'kvlang' ,
91589159
'ksc' => 'Kermit' ,
@@ -9811,6 +9812,8 @@ sub set_constants { # {{{1
98119812
'Jamfile' => 'Jam' ,
98129813
'jamfile' => 'Jam' ,
98139814
'Jamrules' => 'Jam' ,
9815+
'justfile' => 'Justfile' ,
9816+
'Justfile' => 'Justfile' ,
98149817
'Makefile' => 'make' ,
98159818
'makefile' => 'make' ,
98169819
'meson.build' => 'Meson' ,
@@ -10610,6 +10613,10 @@ sub set_constants { # {{{1
1061010613
[ 'call_regexp_common' , 'C' ],
1061110614
[ 'remove_inline' , '#.*$' ],
1061210615
],
10616+
'Justfile' => [
10617+
[ 'remove_matches' , '^\s*#' ],
10618+
[ 'remove_inline' , '#.*$' ],
10619+
],
1061310620
'kvlang' => [
1061410621
["remove_matches", '^\s*#[^:]'],
1061510622
],
@@ -12004,6 +12011,7 @@ sub set_constants { # {{{1
1200412011
'Velocity Template Language' => 1.00,
1200512012
'JCL' => 1.67,
1200612013
'Juniper Junos' => 2.00,
12014+
'Justfile' => 2.50,
1200712015
'kvlang' => 2.00,
1200812016
'Kermit' => 2.00,
1200912017
'Korn Shell' => 3.81,

Unix/t/00_C.t

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,15 +649,20 @@ my @Tests = (
649649
'ref' => '../tests/outputs/Trapezoid_Rule.ipynb.yaml',
650650
'args' => '../tests/inputs/Trapezoid_Rule.ipynb',
651651
},
652+
{
653+
'name' => 'Julia',
654+
'ref' => '../tests/outputs/julia.jl.yaml',
655+
'args' => '../tests/inputs/julia.jl',
656+
},
652657
{
653658
'name' => 'Juniper Junos',
654659
'ref' => '../tests/outputs/config.junos.yaml',
655660
'args' => '../tests/inputs/config.junos',
656661
},
657662
{
658-
'name' => 'Julia',
659-
'ref' => '../tests/outputs/julia.jl.yaml',
660-
'args' => '../tests/inputs/julia.jl',
663+
'name' => 'Justfile',
664+
'ref' => '../tests/outputs/cross-platform.just.yaml',
665+
'args' => '../tests/inputs/cross-platform.just',
661666
},
662667
{
663668
'name' => 'kvlang',

cloc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9145,6 +9145,7 @@ sub set_constants { # {{{1
91459145
'jsp' => 'JSP' , # Java server pages
91469146
'jspf' => 'JSP' , # Java server pages
91479147
'junos' => 'Juniper Junos' ,
9148+
'just' => 'Justfile' ,
91489149
'vm' => 'Velocity Template Language' ,
91499150
'kv' => 'kvlang' ,
91509151
'ksc' => 'Kermit' ,
@@ -9803,6 +9804,8 @@ sub set_constants { # {{{1
98039804
'Jamfile' => 'Jam' ,
98049805
'jamfile' => 'Jam' ,
98059806
'Jamrules' => 'Jam' ,
9807+
'justfile' => 'Justfile' ,
9808+
'Justfile' => 'Justfile' ,
98069809
'Makefile' => 'make' ,
98079810
'makefile' => 'make' ,
98089811
'meson.build' => 'Meson' ,
@@ -10602,6 +10605,10 @@ sub set_constants { # {{{1
1060210605
[ 'call_regexp_common' , 'C' ],
1060310606
[ 'remove_inline' , '#.*$' ],
1060410607
],
10608+
'Justfile' => [
10609+
[ 'remove_matches' , '^\s*#' ],
10610+
[ 'remove_inline' , '#.*$' ],
10611+
],
1060510612
'kvlang' => [
1060610613
["remove_matches", '^\s*#[^:]'],
1060710614
],
@@ -11996,6 +12003,7 @@ sub set_constants { # {{{1
1199612003
'Velocity Template Language' => 1.00,
1199712004
'JCL' => 1.67,
1199812005
'Juniper Junos' => 2.00,
12006+
'Justfile' => 2.50,
1199912007
'kvlang' => 2.00,
1200012008
'Kermit' => 2.00,
1200112009
'Korn Shell' => 3.81,

tests/inputs/cross-platform.just

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# https://github.com/casey/just/blob/master/examples/cross-platform.just
2+
# use with https://github.com/casey/just
3+
#
4+
# Example cross-platform Python project
5+
#
6+
7+
python_dir := if os_family() == "windows" { "./.venv/Scripts" } else { "./.venv/bin" }
8+
python := python_dir + if os_family() == "windows" { "/python.exe" } else { "/python3" }
9+
system_python := if os_family() == "windows" { "py.exe -3.9" } else { "python3.9" }
10+
11+
# Set up development environment
12+
bootstrap:
13+
if test ! -e .venv; then {{ system_python }} -m venv .venv; fi
14+
{{ python }} -m pip install --upgrade pip wheel pip-tools
15+
{{ python_dir }}/pip-sync
16+
17+
# Upgrade Python dependencies
18+
upgrade-deps: && bootstrap
19+
{{ python_dir }}/pip-compile --upgrade
20+
21+
# Sample project script 1
22+
script1:
23+
{{ python }} script1.py
24+
25+
# Sample project script 2
26+
script2 *ARGS:
27+
{{ python }} script2.py {{ ARGS }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# github.com/AlDanial/cloc
3+
header :
4+
cloc_url : github.com/AlDanial/cloc
5+
cloc_version : 2.06
6+
elapsed_seconds : 0.00395989418029785
7+
n_files : 1
8+
n_lines : 27
9+
files_per_second : 252.5320007225
10+
lines_per_second : 6818.3640195075
11+
report_file : ../outputs/cross-platform.just.yaml
12+
'Justfile' :
13+
nFiles: 1
14+
blank: 5
15+
comment: 9
16+
code: 13
17+
SUM:
18+
blank: 5
19+
comment: 9
20+
code: 13
21+
nFiles: 1

0 commit comments

Comments
 (0)