Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - chore(scripts): require all scripts to be documented in the README #14539

Closed
wants to merge 21 commits into from

Conversation

grunweg
Copy link
Collaborator

@grunweg grunweg commented Jul 8, 2024

This is valuable so

  • contributors can discover existing useful tools,
  • existing knowledge is documented and not lost
  • it (hopefully) inspires to re-consider if all each script is useful/why we have it. Having a bounded number of entry-points to CI is useful to have.

This is implemented as a new check, piggy-backing the lint_style executable.

To make CI pass, this PR adds a README file to scripts, containing stub descriptions for the current files. Future PRs should fill this out.


Open in Gitpod

@grunweg grunweg added WIP Work in progress t-linter Linter labels Jul 8, 2024
@grunweg
Copy link
Collaborator Author

grunweg commented Jul 8, 2024

@semorrison You may be interested in this one: obviously, it's not ready to land yet.

Copy link

github-actions bot commented Jul 8, 2024

PR summary fbd5774b08

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ allScriptsDocumented

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.

@grunweg grunweg force-pushed the MR-lint-undocumented-scripts branch from f332ff6 to ee8a6aa Compare July 9, 2024 07:00
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 13, 2024
mathlib-bors bot pushed a commit that referenced this pull request Aug 15, 2024
In detail, this PR
- moves the executable bit check into the .yml files, instead of the shell script
- adds a `--fix` flag to `lint-style`, for fixing style errors (when possible)
- moves calling `lint-style.py` into `lake exe lint-style`, and
- switches the CI workflow to call `lake exe lint-style` instead, and removes `lint-style.sh`

Ideally, `lint-style.py` will be completely rewritten in Lean soon, so this calling of an external process is only temporary.

Helps with #14539.
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
In detail, this PR
- moves the executable bit check into the .yml files, instead of the shell script
- adds a `--fix` flag to `lint-style`, for fixing style errors (when possible)
- moves calling `lint-style.py` into `lake exe lint-style`, and
- switches the CI workflow to call `lake exe lint-style` instead, and removes `lint-style.sh`

Ideally, `lint-style.py` will be completely rewritten in Lean soon, so this calling of an external process is only temporary.

Helps with #14539.
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
In detail, this PR
- moves the executable bit check into the .yml files, instead of the shell script
- adds a `--fix` flag to `lint-style`, for fixing style errors (when possible)
- moves calling `lint-style.py` into `lake exe lint-style`, and
- switches the CI workflow to call `lake exe lint-style` instead, and removes `lint-style.sh`

Ideally, `lint-style.py` will be completely rewritten in Lean soon, so this calling of an external process is only temporary.

Helps with #14539.
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 12, 2024
In detail, this PR
- moves the executable bit check into the .yml files, instead of the shell script
- adds a `--fix` flag to `lint-style`, for fixing style errors (when possible)
- moves calling `lint-style.py` into `lake exe lint-style`, and
- switches the CI workflow to call `lake exe lint-style` instead, and removes `lint-style.sh`

Ideally, `lint-style.py` will be completely rewritten in Lean soon, so this calling of an external process is only temporary.

Helps with #14539.
@kim-em
Copy link
Contributor

kim-em commented Oct 25, 2024

Apologies this rotted. I just merged master, hopefully it works.

I like this! Please merge if you are too, otherwise we can discuss what remains to be done.

bors d+

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 25, 2024

✌️ grunweg can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 25, 2024
@grunweg grunweg removed the WIP Work in progress label Oct 27, 2024
@grunweg
Copy link
Collaborator Author

grunweg commented Oct 30, 2024

Thank you for documenting most entries! I just took a pass over the ones I know, and formatted the file consistently. This is just missing an entry on ~four scripts used to generate the PR summary comment. Help on these is still welcome - though in my opinion, this is already useful.

From my point of view, this can be merged. @bryangingechen I saw you self-assigned this. If I don't hear objections from you, I will merge this in a day (or so).

@adomani
Copy link
Collaborator

adomani commented Oct 30, 2024

I pushed a possible categorization of the remaining scripts with some details. Let me know if this is good! A lot of these files also have individual docs, so the combination of the generic dispatch and the specific information is probably good enough.

scripts/README.md Outdated Show resolved Hide resolved
scripts/README.md Outdated Show resolved Hide resolved
@grunweg
Copy link
Collaborator Author

grunweg commented Oct 30, 2024

Thanks for adding the last missing docs! I like the changes and just pushed a last tweak. I consider this really really ready now.

@kim-em
Copy link
Contributor

kim-em commented Oct 30, 2024

Nice! Thank @grunweg for making this happen, and @adomani and @jcommelin for contributing documentation. I feel much better about our scripts/ directory now!

Next up, rewrite all the python ones in lean. :-)

bors merge

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Oct 30, 2024
mathlib-bors bot pushed a commit that referenced this pull request Oct 30, 2024
…14539)

This is valuable so
- contributors can discover existing useful tools,
- existing knowledge is documented and not lost
- it (hopefully) inspires to re-consider if all each script is useful/why we have it. Having a [bounded number of entry-points](https://matklad.github.io/2023/12/31/O(1)-build-file.html) to CI is useful to have.

This is implemented as a new check, piggy-backing the `lint_style` executable.

To make CI pass, this PR adds a README file to `scripts`, containing stub descriptions for the current files. Future PRs should fill this out.



Co-authored-by: Kim Morrison <[email protected]>
Co-authored-by: Michael Rothgang <[email protected]>
Co-authored-by: Damiano Testa <[email protected]>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 30, 2024

Build failed:

@kim-em
Copy link
Contributor

kim-em commented Oct 30, 2024

Haha, it caught a new one that has arrived on master!

@kim-em
Copy link
Contributor

kim-em commented Oct 30, 2024

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Oct 30, 2024
…14539)

This is valuable so
- contributors can discover existing useful tools,
- existing knowledge is documented and not lost
- it (hopefully) inspires to re-consider if all each script is useful/why we have it. Having a [bounded number of entry-points](https://matklad.github.io/2023/12/31/O(1)-build-file.html) to CI is useful to have.

This is implemented as a new check, piggy-backing the `lint_style` executable.

To make CI pass, this PR adds a README file to `scripts`, containing stub descriptions for the current files. Future PRs should fill this out.



Co-authored-by: Kim Morrison <[email protected]>
Co-authored-by: Michael Rothgang <[email protected]>
Co-authored-by: Damiano Testa <[email protected]>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 30, 2024

Build failed:

@kim-em
Copy link
Contributor

kim-em commented Oct 30, 2024

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Oct 31, 2024
…14539)

This is valuable so
- contributors can discover existing useful tools,
- existing knowledge is documented and not lost
- it (hopefully) inspires to re-consider if all each script is useful/why we have it. Having a [bounded number of entry-points](https://matklad.github.io/2023/12/31/O(1)-build-file.html) to CI is useful to have.

This is implemented as a new check, piggy-backing the `lint_style` executable.

To make CI pass, this PR adds a README file to `scripts`, containing stub descriptions for the current files. Future PRs should fill this out.



Co-authored-by: Kim Morrison <[email protected]>
Co-authored-by: Michael Rothgang <[email protected]>
Co-authored-by: Damiano Testa <[email protected]>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 31, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(scripts): require all scripts to be documented in the README [Merged by Bors] - chore(scripts): require all scripts to be documented in the README Oct 31, 2024
@mathlib-bors mathlib-bors bot closed this Oct 31, 2024
@mathlib-bors mathlib-bors bot deleted the MR-lint-undocumented-scripts branch October 31, 2024 00:31
@grunweg
Copy link
Collaborator Author

grunweg commented Oct 31, 2024

Next up, rewrite all the python ones in lean. :-)

@kim-em I do have some in-progress PRs regarding this; review welcome :-)

grunweg added a commit that referenced this pull request Nov 2, 2024
…14539)

This is valuable so
- contributors can discover existing useful tools,
- existing knowledge is documented and not lost
- it (hopefully) inspires to re-consider if all each script is useful/why we have it. Having a [bounded number of entry-points](https://matklad.github.io/2023/12/31/O(1)-build-file.html) to CI is useful to have.

This is implemented as a new check, piggy-backing the `lint_style` executable.

To make CI pass, this PR adds a README file to `scripts`, containing stub descriptions for the current files. Future PRs should fill this out.



Co-authored-by: Kim Morrison <[email protected]>
Co-authored-by: Michael Rothgang <[email protected]>
Co-authored-by: Damiano Testa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated ready-to-merge This PR has been sent to bors. t-linter Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants