Skip to content

Commit 27643df

Browse files
committed
Allow 128 explicitly: is this worth it?
1 parent 29c2f97 commit 27643df

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

scripts/lint_style.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ def lintStyleCli (args : Cli.Parsed) : IO UInt32 := do
2626
for s in ["Archive.lean", "Counterexamples.lean", "Mathlib.lean"] do
2727
let n ← lintAllFiles (System.mkFilePath [s]) errorStyle
2828
numberErrorFiles := numberErrorFiles + n
29-
-- Make sure to return an exit code of at most 125, so this return value can be used further
30-
-- in shell scripts.
31-
return min numberErrorFiles 125
29+
-- Make sure this return value can be used further in shell scripts:
30+
-- exit codes 125 and 126 are disallowed, as is any number higher than 128.
31+
if numberErrorFiles == 128 then return 128
32+
else return min numberErrorFiles 125
3233

3334
/-- Setting up command line options and help text for `lake exe lint_style`. -/
3435
-- so far, no help options or so: perhaps that is fine?

scripts/mk_all.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ def mkAllCLI (args : Parsed) : IO UInt32 := do
6868
updates := updates + 1
6969
if updates == 0 then
7070
IO.println "No update necessary"
71-
-- Make sure to return an exit code of at most 125, so this return value can be used further
72-
-- in shell scripts.
73-
return min updates 125
71+
-- Make sure this return value can be used further in shell scripts:
72+
-- exit codes 125 and 126 are disallowed, as is any number higher than 128.
73+
if updates == 128 then return 128
74+
else return min updates 125
7475

7576
open Cli in
7677
/-- Setting up command line options and help text for `lake exe mk_all`. -/

0 commit comments

Comments
 (0)