File tree 3 files changed +31
-11
lines changed
3 files changed +31
-11
lines changed Original file line number Diff line number Diff line change 38
38
env TEST_LANG="c" nimble test
39
39
env TEST_LANG="cpp" nimble test
40
40
41
+
42
+ lint :
43
+ name : " Check formatting"
44
+ runs-on : ubuntu-latest
45
+ steps :
46
+ - name : Checkout
47
+ uses : actions/checkout@v4
48
+ with :
49
+ fetch-depth : 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base
50
+
51
+ - name : Check nph formatting
52
+ # Pin nph to a specific version to avoid sudden style differences.
53
+ run : |
54
+ VERSION="v0.6.0"
55
+ ARCHIVE="nph-linux_x64.tar.gz"
56
+ curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE}
57
+ tar -xzf ${ARCHIVE}
58
+ ./nph .
59
+ git diff --exit-code
Original file line number Diff line number Diff line change 1
1
# Package
2
2
3
- version = " 0.4.0"
4
- author = " Jacek Sieka"
5
- description = " Friendly, exception-free value-or-error returns, similar to Option[T]"
6
- license = " MIT"
7
- skipDirs = @ [" benchmarks" , " tests" ]
8
- installFiles = @ [" results.nim" ]
3
+ version = " 0.4.0"
4
+ author = " Jacek Sieka"
5
+ description = " Friendly, exception-free value-or-error returns, similar to Option[T]"
6
+ license = " MIT"
7
+ skipDirs = @ [" benchmarks" , " tests" ]
8
+ installFiles = @ [" results.nim" ]
9
9
# Dependencies
10
10
11
11
requires " nim >= 1.2"
@@ -15,8 +15,7 @@ proc test(env, path: string) =
15
15
var lang = " c"
16
16
if existsEnv " TEST_LANG" :
17
17
lang = getEnv " TEST_LANG"
18
- exec " nim " & lang & " " & env &
19
- " -r " & path
18
+ exec " nim " & lang & " " & env & " -r " & path
20
19
21
20
task test, " Runs the test suite" :
22
21
for f in [" test_results.nim" , " test_results2.nim" ]:
Original file line number Diff line number Diff line change @@ -502,6 +502,7 @@ block: # Result[T, void] aka `Opt`
502
502
$ x
503
503
)
504
504
.get () == $ oOk.get ()
505
+
505
506
oOk
506
507
.map (
507
508
proc (x: int ) =
@@ -593,10 +594,11 @@ block: # Result[T, void] aka `Opt`
593
594
doAssert oOk.value () + 1 notin oOk
594
595
595
596
block : # Nested `?`
596
- proc inside : Opt [int ] =
597
+ proc inside () : Opt [int ] =
597
598
ok (5 )
598
- proc kput : Opt [int ] =
599
- ok (? inside ())
599
+
600
+ proc kput (): Opt [int ] =
601
+ ok (? inside ())
600
602
601
603
doAssert kput () == Opt .some (5 )
602
604
You can’t perform that action at this time.
0 commit comments