-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from jorenham/codegen-docs
add docs to the `codegen/` directory
- Loading branch information
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
generated_code_marker: "@generated" | ||
formatter: ["./.venv/bin/ruff", "format", "--stdin-filename=__generated__.pyi", "-"] | ||
blacklist_patterns: [] | ||
modules: ["libcst.codemod.commands", "codegen.mods"] | ||
repo_root: "." | ||
formatter: | ||
- "./.venv/bin/ruff" | ||
- "format" | ||
- "--stdin-filename=__generated__.pyi" | ||
- "-" | ||
modules: | ||
- "libcst.codemod.commands" | ||
- "codegen.mods" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# `scipy-stubs/codegen` | ||
|
||
To run a codemod, ensure that you are in the root directory of the `scipy-stubs` repository and run: | ||
|
||
```bash | ||
poe codemod $NAME | ||
``` | ||
|
||
where `$NAME` is the name is the name of the codemod, which can be one of: | ||
|
||
- `AnnotateMissing` - Sets the default return type to `None`, and sets the other missing annotations to `scipy._typing.Untyped`. | ||
- `FixTrailingComma` - Adds a trailing comma to parameters that don't fit on one line, so that ruff formats them correctly. | ||
|
||
> [!NOTE] | ||
> The codemods require `libcst`, which is installable through the **optional** `codegen` dependency group: | ||
> | ||
> ```bash | ||
> poetry install --with=codegen | ||
> ``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters