Skip to content
Merged
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
20 changes: 20 additions & 0 deletions .github/scripts/validate-git-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Generated by flext-infra. AI Hub owns Git hook installation.
set -euo pipefail
stage="${1:?Git hook stage is required}"
cd "$(git rev-parse --show-toplevel)"
case "$stage" in
pre-commit|pre-merge-commit)
if ! git diff --quiet --ignore-submodules=none || [ -n "$(git ls-files --others --exclude-standard)" ]; then
printf '%s\n' 'Commit blocked: stage the complete candidate before validation; partial staging is preserved.' >&2
exit 1
fi
;;
pre-push)
test -z "$(git status --porcelain --untracked-files=all --ignore-submodules=none)"
;;
*) printf 'Unsupported Git hook stage: %s\n' "$stage" >&2; exit 2 ;;
esac
# --all-files avoids pre-commit hook-impl's stash of unstaged changes.
unset SKIP PRE_COMMIT_ALLOW_NO_CONFIG
pre-commit run --all-files --hook-stage "$stage"
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
*/.hooks.json.agents-governance.json
.claude/*.agents-governance.json
.gemini/*.agents-governance.json
.claude/settings.json
.claude/settings.local.json
.gemini/settings.json

# Operator-private local config overrides
/config/codegen-overrides.local.yaml
Expand Down Expand Up @@ -359,6 +357,7 @@ CLAUDE.local.md
!.github/scripts/
!.github/scripts/check-beads-policy.sh
!.github/scripts/check-cqrs-compliance.sh
!.github/scripts/validate-git-hook.sh
!.github/scripts/flext-law-loop.sh
!tests/fixtures/
!tests/fixtures/ci/
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ endif
endif
# End SECTION: REPOSITORY_ROOT isolation
# === SECTION: verb dispatch (managed) ===
# Source: config:make.verbs and the canonical gate vocabulary.
# Source: config:make.verbs and the canonical gate vocabulary. A verb exists
# only in the profiles it declares (make.verbs[].profiles).
PUBLIC_VERBS := help setup upg build check test test-full fmt fix fix-enforcement audit status docs clean release-plan release-version release-tag release-build publication gen initialize mod waza duplication sonarcloud-sync
BUILTIN_VERBS := help setup upg build check test test-full fmt fix fix-enforcement audit status docs clean release-plan release-version release-tag release-build publication gen initialize mod waza duplication sonarcloud-sync
SCRIPT_VERBS :=
Expand Down
25 changes: 6 additions & 19 deletions docs/api-reference/generated/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,14 @@

<!-- AUTO-GENERATED — DO NOT EDIT MANUALLY -->

- Package: `flext_cli`
- Version: `0.12.0`
- Description: FLEXT CLI - Developer Command Line Interface
- Doc summary: Flext Cli package.
- Classifiers: Development Status :: 3 - Alpha, Intended Audience :: Developers,
Operating System :: OS Independent, Programming Language :: Python :: 3 :: Only,
Programming Language :: Python :: 3.13, Topic :: Software Development :: Libraries ::
Python Modules, Typing :: Typed
- Project class: `domain`
- Keywords: `cli`, `command-line`, `enterprise`, `flext`, `tools`, `typed`
- Main facades: `FlextCli`, `FlextCliAuth`, `FlextCliCli`, `FlextCliCmd`,
`FlextCliCommonParams`, `FlextCliConfig`, `FlextCliConstants`, `FlextCliDocx` (+17
more)
- Alias exports: `c`, `d`, `e`, `h`, `m`, `p`, `r`, `s`, `t`, `u`, `x`
- Public symbol exports: `FlextCli`, `FlextCliAuth`, `FlextCliCli`, `FlextCliCmd`,
`FlextCliCommonParams`, `FlextCliConfig`, `FlextCliConstants`, `FlextCliDocx`,
`FlextCliFileTools`, `FlextCliFormatters` (+18 more)
- Exported module shortcuts: `config`, `services`
- Generated module pages: `26`
- Governed projects: `0`
- Project classes: _none_

Generated from workspace discovery, `pyproject.toml`, public exports, and docstrings.

## Next Pages

- [Public API](public-api.md)
- [Module Index](modules/index.md)
- [Workspace Module Pages](projects/index.md)
- [Project Catalog](../../projects/generated/catalog.md)
13 changes: 13 additions & 0 deletions docs/api-reference/generated/projects/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Workspace Module Pages

<!-- TOC START -->

- No sections found

<!-- TOC END -->

<!-- AUTO-GENERATED — DO NOT EDIT MANUALLY -->

Each project renders one page per public module, driven by docstrings.

_No projects discovered._
15 changes: 15 additions & 0 deletions docs/projects/generated/catalog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# FLEXT Project Catalog

<!-- TOC START -->

- No sections found

<!-- TOC END -->

<!-- AUTO-GENERATED — DO NOT EDIT MANUALLY -->

Project links resolve to the generated root API reference for each governed FLEXT
package.

| project | class | package | description |
|---|---|---|---|
9 changes: 5 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# AUTO-GENERATED — DO NOT EDIT MANUALLY
site_name: flext-cli Documentation
site_description: Generated documentation for flext-cli
site_name: flext-cli
site_description: Workspace documentation generated from code and curated root docs
site_url: https://github.com/flext-sh/flext-cli/blob/main/README.md
repo_name: flext-sh/flext-cli
repo_url: https://github.com/flext-sh/flext-cli
edit_uri: edit/main/flext-cli/
docs_dir: docs
site_dir: .reports/docs/site

Expand Down Expand Up @@ -88,7 +87,9 @@ markdown_extensions:
custom_checkbox: true

# MkDocs discovers the complete documentation tree, including maintained pages.
# A fixed three-page nav silently omitted every domain guide and decision record.
# A fixed three-page nav silently omitted guides, standards, and decisions.
not_in_nav: |
api-reference/generated/**
validation:
omitted_files: warn
absolute_links: warn
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# @flext-generated: continuous
# @flext-owner: flext-infra/config/codegen.yaml + flext-infra/src/flext_infra/templates/project/base/pyproject.toml.j2
# @flext-adjust: MANAGED=conflict_sections + overwrite_project_keys. CUSTOM=preserve_project_keys and [tool.*] outside conflict_sections. Never edit this projection.
# @flext-regenerate: make gen

[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
Expand Down Expand Up @@ -131,7 +136,6 @@ exclude_also = [
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
]
fail_under = 45
precision = 2
show_missing = true
skip_covered = false
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_runtime_process_descendants.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ def test_normal_root_exit_leaves_no_descendant(self, tmp_path: Path) -> None:
)

result = u.Cli().run_to_file(
[sys.executable, "-I", "-S", "-c", parent, str(process_info)],
output_file,
[sys.executable, "-I", "-S", "-c", parent, str(process_info)], output_file
)

tm.ok(result)
Expand Down
25 changes: 18 additions & 7 deletions tests/unit/test_utilities_cov.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Behavioral tests for the CLI utilities public contract (``u`` / ``u.Cli``).

Exercises only the observable contract of the utility helpers:
- ``u.process`` — item processing with predicate filtering and error policy.
- ``u.process`` — item processing with predicate filtering and fail-loud
first-failure propagation.
- ``u.Cli.validate_not_empty`` — emptiness validation returning ``r[bool]``.
- ``u.Cli.project_names_from_values`` / ``project_numbers_from_values`` —
CLI selector normalization.
Expand Down Expand Up @@ -34,15 +35,25 @@ def test_process_returns_mapped_values_on_success(self) -> None:

def test_process_fails_when_processor_raises(self) -> None:
"""Verify that process fails when processor raises."""
result = u.process([1, 0], _raise_on_zero, on_error="fail")
result = u.process([1, 0], _raise_on_zero)
tm.fail(result)
tm.that(result.error or "", has="0")

def test_process_skip_policy_drops_failing_items(self) -> None:
"""Verify that process skip policy drops failing items."""
result = u.process([1, 0, 5], _raise_on_zero, on_error="skip")
tm.ok(result)
tm.that(list(result.unwrap()), eq=[10, 2])
def test_process_fails_loud_with_original_exception_and_stops_at_first_failure(
self,
) -> None:
"""Verify process stops at the first failure, never visiting later items."""
visited: list[int] = []

def _tracking_raise_on_zero(value: int) -> int:
visited.append(value)
return _raise_on_zero(value)

result = u.process([1, 0, 5], _tracking_raise_on_zero)
tm.fail(result)
tm.that(visited, eq=[1, 0])
assert isinstance(result.exception, ValueError)
tm.that(str(result.exception), eq="div zero")

def test_process_predicate_excludes_items_before_processing(self) -> None:
"""Verify that process predicate excludes items before processing."""
Expand Down
23 changes: 12 additions & 11 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading