Option C Tools
Loading...
Searching...
No Matches
policy.py File Reference

Go to the source code of this file.

Namespaces

namespace  oct
namespace  oct.git
namespace  oct.git.policy

Functions

str|None oct.git.policy.generate_branch_name_from_message (str message)
bool oct.git.policy.is_protected_branch (str|None branch, dict|None octrc)
tuple[bool, str] oct.git.policy.validate_branch_name (str|None branch, dict|None octrc)
Profile oct.git.policy._resolve_auto_profile (str|None branch)
Profile oct.git.policy.resolve_effective_profile (str|None branch, dict|None octrc, str|None cli_override)
int oct.git.policy.apply_profile_policy (str profile, "QualityGateResult" result)
tuple[bool, str] oct.git.policy.check_protected_branch_commit (str|None branch, dict|None octrc, str profile)
tuple[bool, str] oct.git.policy.validate_ignore_pattern (str pattern)
list[str] oct.git.policy._read_gitignore (Path repo_root)
None oct.git.policy._write_gitignore (Path repo_root, list[str] lines)
tuple[int, int] oct.git.policy._find_oct_block (list[str] lines)
tuple[list[str], list[str]] oct.git.policy.list_ignore_patterns (Path repo_root)
list[str] oct.git.policy.add_ignore_patterns (Path repo_root, list[str] patterns)
tuple[bool, str] oct.git.policy.remove_ignore_pattern (Path repo_root, str pattern)

Variables

 oct.git.policy.Profile = Literal["proto", "compact", "strict"]
tuple oct.git.policy.VALID_PROFILES = ("proto", "compact", "strict")
Profile oct.git.policy.DEFAULT_PROFILE = "compact"
tuple oct.git.policy.DEFAULT_PROTECTED_BRANCHES = ("main", "master")
dict oct.git.policy.PROFILE_MATRIX
bool oct.git.policy.SECRETS_ALWAYS_BLOCKS = True
tuple oct.git.policy.DEFAULT_BRANCH_PATTERNS
dict oct.git.policy._AUTO_PROFILE_MAP
dict oct.git.policy._COMMIT_TYPE_TO_PREFIX
int oct.git.policy._BRANCH_SLUG_MAX_LEN = 50
str oct.git.policy.OC_GITIGNORE_MARKER_START = "# --- Option C defaults ---"
str oct.git.policy.OC_GITIGNORE_MARKER_END = "# --- end Option C ---"
re oct.git.policy._VALID_PATTERN_RE = re.compile(r"^[A-Za-z0-9_./*?\‍[\‍]\-]+$")