Skip to content

Commit

Permalink
Print minimal files in import tree in CI (#10)
Browse files Browse the repository at this point in the history
This PR adds a CI step that prints the names of all `sorry`-free files in the `LeanCamCombi` source directory (except those under `ExampleSheets`) whose list of imports does not contain any import from `LeanCamCombi`. These files are good candidates to be upstreamed to mathlib.
  • Loading branch information
zeramorphic authored Nov 4, 2023
1 parent 2d92fcd commit 974da50
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/push_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ jobs:
with:
fetch-depth: 0

- name: print files to upstream
run: |
grep -r --exclude-dir=ExampleSheets --files-without-match 'import LeanCamCombi' LeanCamCombi | sort > 1.txt
grep -r --exclude-dir=ExampleSheets --files-with-match 'sorry' LeanCamCombi | sort > 2.txt
comm -23 1.txt 2.txt | sed -e 's/^\(.*\)$/- [`\1`](https:\/\/github.com\/YaelDillies\/LeanCamCombi\/blob\/main\/\1)/' > docs/_includes/files_to_upstream.md
rm 1.txt 2.txt
- name: install elan
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain leanprover/lean4:4.0.0

Expand Down
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ vendor
blueprint/
blueprint.pdf
docs/

# Noisy files that are generated by CI.
_includes/files_to_upstream.md
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ The project is not yet finished. The following table details live which files ar

{% include sorries.md %}

## Files to upstream to mathlib

{% include files_to_upstream.md %}

## The source

The definitions, theorems and proofs in this repository are taken from three Cambridge courses:
Expand Down

0 comments on commit 974da50

Please sign in to comment.