Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ repos:
types: [python]
pass_filenames: false
args: []
- id: update-cli-docs
name: update-cli-docs
entry: python tools/generate_cli_options_md.py
language: python
pass_filenames: false
files: ^(src/aiperf/cli.*\.py|src/aiperf/common/config/.*\.py|docs/cli_options\.md)$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.8
hooks:
Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
test-verbose init-files setup-venv setup-mkinit install-mock-server \
integration-tests integration-tests-ci integration-tests-verbose \
test-integration test-integration-ci test-integration-verbose \
test-stress stress-tests internal-help help
test-stress stress-tests internal-help help \
update-cli-docs check-cli-docs


# Include user-defined environment variables
Expand Down Expand Up @@ -95,6 +96,15 @@ internal-help:
init-files: #? run mkinit to generate the __init__.py files.
$(activate_venv) && tools/generate_init_files.sh

update-cli-docs: #? regenerate docs/cli_options.md from aiperf profile --help.
@printf "$(bold)$(green)Regenerating CLI options documentation...$(reset)\n"
$(activate_venv) && python tools/generate_cli_options_md.py
@printf "$(bold)$(green)Done! docs/cli_options.md has been updated.$(reset)\n"

check-cli-docs: #? check if docs/cli_options.md is in sync with aiperf profile --help.
@printf "$(bold)$(blue)Checking if CLI options documentation is up to date...$(reset)\n"
$(activate_venv) && python tools/generate_cli_options_md.py --check

ruff lint: #? run the ruff linters
$(activate_venv) && ruff check . $(args)

Expand Down
Loading
Loading