You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
926 B
30 lines
926 B
# Naming constraint rules (example constraint file)
|
|
|
|
rules:
|
|
- name: module_file_names
|
|
rule: "Use snake_case for Python module filenames (e.g., text_pipeline.py, ai_provider.py)."
|
|
examples:
|
|
- good: "text_pipeline.py"
|
|
- bad: "TextPipeline.py"
|
|
|
|
- name: function_names
|
|
rule: "Use snake_case for functions and methods."
|
|
examples:
|
|
- good: "def compute_similarities(...):"
|
|
- bad: "def ComputeSimilarities(...):"
|
|
|
|
- name: class_names
|
|
rule: "Use PascalCase for classes."
|
|
examples:
|
|
- good: "class MotionDatabase:"
|
|
- bad: "class motion_database:"
|
|
|
|
- name: constants
|
|
rule: "Constants use UPPER_SNAKE_CASE."
|
|
examples:
|
|
- good: "VOTE_MAP = { ... }"
|
|
- bad: "vote_map = { ... }"
|
|
|
|
enforcement_examples:
|
|
- "Add a linter rule in CI: ruff or flake8 naming plugin to detect violations."
|
|
- "Run `python -m pip install ruff` and `ruff check` as part of CI."
|
|
|