Skip to content

Commit dd51471

Browse files
committed
[CI] Add a job to check for duplicate files
Those would yield ambiguity when doing "From Stdlib Require File.". There are already a few in the prelude, let's not add more.
1 parent 5f9f464 commit dd51471

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.github/workflows/basic-checks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ jobs:
1212
uses: actions/checkout@v4
1313
- name: Check consistency of files in Makefiles
1414
run: dev/tools/check-make-sync.sh
15+
- name: Check for duplicate files
16+
run: dev/tools/check-duplicate-files.sh

dev/tools/check-duplicate-files.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/sh
2+
3+
# List of all files in the coq repo
4+
FILES_PRELUDE="\
5+
ArrayAxioms.v \
6+
Basics.v \
7+
BinNums.v \
8+
CMorphisms.v \
9+
CRelationClasses.v \
10+
CarryType.v \
11+
Datatypes.v \
12+
Decimal.v \
13+
Equivalence.v \
14+
FloatAxioms.v \
15+
FloatClass.v \
16+
FloatOps.v \
17+
Hexadecimal.v \
18+
Init.v \
19+
IntDef.v \
20+
ListDef.v \
21+
Logic.v \
22+
Ltac.v \
23+
Morphisms.v \
24+
Morphisms_Prop.v \
25+
Nat.v \
26+
NatDef.v \
27+
Notations.v \
28+
Number.v \
29+
Peano.v \
30+
PosDef.v \
31+
Prelude.v \
32+
PrimArray.v \
33+
PrimFloat.v \
34+
PrimInt63.v \
35+
PrimString.v \
36+
PrimStringAxioms.v \
37+
RelationClasses.v \
38+
Relation_Definitions.v \
39+
Setoid.v \
40+
SetoidTactics.v \
41+
Sint63Axioms.v \
42+
SpecFloat.v \
43+
Specif.v \
44+
Sumbool.v \
45+
Tactics.v \
46+
Uint63Axioms.v \
47+
Utils.v \
48+
Wf.v \
49+
ssrbool.v \
50+
ssrclasses.v \
51+
ssreflect.v \
52+
ssrfun.v \
53+
ssrmatching.v \
54+
ssrsetoid.v \
55+
ssrunder.v"
56+
57+
ALL_FILES=all_files__
58+
ALL_FILES_UNIQ=all_files_uniq__
59+
60+
rm -f ${ALL_FILES} ${ALL_FILES_UNIQ}
61+
(for f in ${FILES_PRELUDE} $(find theories -name "*.v") ; do basename $f ; done) | sort > ${ALL_FILES}
62+
uniq ${ALL_FILES} > ${ALL_FILES_UNIQ}
63+
64+
if $(diff -q ${ALL_FILES_UNIQ} ${ALL_FILES} > /dev/null) ; then
65+
echo "No files with duplicate name"
66+
else
67+
echo "Some files with the same name"
68+
diff ${ALL_FILES_UNIQ} ${ALL_FILES}
69+
exit 1
70+
fi
71+
72+
rm -f ${ALL_FILES} ${ALL_FILES_UNIQ}

0 commit comments

Comments
 (0)