PhysLean/scripts
Joseph Tooby-Smith f6739e9f31
feat: Semiformal results around Em (#441)
* feat: Add tags

* feat: Add tags to YML

* refactor: Lint

* feat: Sort TODOs

* feat: Add semi-formal results

* feat: fix name

* refactor: Lint

* feat: semi-formal results around EM

* feat: Lint and make tags function
2025-04-01 15:15:02 +00:00
..
MetaPrograms feat: Semiformal results around Em (#441) 2025-04-01 15:15:02 +00:00
check_file_imports.lean refactor: Move files and update toml 2025-02-14 08:45:02 +00:00
find_TODOs.lean refactor: Move files and update toml 2025-02-14 08:45:02 +00:00
lint-all.sh refactor: some docs 2025-02-14 08:50:24 +00:00
lint-style.py refactor: Lint 2024-08-15 10:16:42 -04:00
lint-style.sh refactor: some docs 2025-02-14 08:50:24 +00:00
lint_all.lean feat: Update style lint 2025-03-21 11:22:23 -04:00
mathlib_textLint_on_hepLean.lean refactor: some docs 2025-02-14 08:50:24 +00:00
nolints-style.txt chore: Add Mathlib text-based linters 2024-07-12 16:31:33 -04:00
nolints.json refactor: Move constructors 2024-07-16 11:40:00 -04:00
openAI_doc_check.lean refactor: some docs 2025-02-14 08:50:24 +00:00
README.md refactor: rename top level directories 2025-02-28 15:03:07 +00:00
stats.lean refactor: website 2025-02-14 08:56:51 +00:00
style-exceptions.txt feat: Add relation to mathlib4 defns 2024-04-17 10:25:05 -04:00
Template.lean feat: Update website with Curated notes 2025-02-27 11:07:23 +00:00
type_former_lint.lean refactor: some docs 2025-02-14 08:50:24 +00:00

Scripts associated with PhysLean

lint-style.py and lint-style.sh

Taken from Mathlib's linters. These perform text-based linting of the code.

These are to be slowly replaced with code written in Lean.

hepLean_style_lint

Checks the following in PhysLean

  • There are no double empty lines.
  • There are no non-initial double spaces. Passing this linter is currently not required to pass CI on github.

Run using

lake exe hepLean_style_lint

check_file_imports.lean

Checks all files are correctly imported into PhysLean.lean.

Run using

lake exe check_file_imports

type_former_lint.lean

Checks whether the name of definitions which form a type or prop starts with a capital letter.

Run using

lake exe type_former_lint

stats.sh

Outputs statistics for PhysLean.

Run using

lake exe stats

openAI_doc_check.lean

Uses openAI's API to check for spelling mistakes etc. in doc strings.

This code needs https://github.com/jstoobysmith/Lean_llm_fork to be installed.

It also needs the environment variable OPENAI_API_KEY defined using e.g.

export OPENAI_API_KEY=<Your-openAI-key>

Run on a specific file using

lake exe openAI_doc_check <module_name>

where <module_name> is e.g. PhysLean.Relativity.SpaceTime.Basic.

Run on a random file using

lake exe openAI_doc_check random

lint-all.sh

Performs all linting checks on PhysLean.

Run using

./scripts/lint-all.sh

Other useful commands

  • To build PhysLean use
lake exe cache get
lake build
  • To update PhysLean's dependencies use
lake update