Cybersecurity-Projects/PROJECTS/foundations/http-headers-scanner/.style.yapf

105 lines
4.7 KiB
Plaintext

# ©AngelaMos | 2026
# .style.yapf
#
# Configuration for yapf, our Python code formatter. yapf rewrites
# Python files to match these rules so every file looks identical
# no matter who wrote it.
#
# The two settings most worth knowing:
# based_on_style = pep8 → start from PEP 8 (the official style)
# column_limit = 75 → wrap lines at 75 characters
#
# Run with: `just format`
[style]
# Start from PEP 8 (Python's official style guide). Every other
# setting below tweaks PEP 8 in some specific direction.
based_on_style = pep8
# Wrap any line longer than this many columns.
column_limit = 75
# Use 4 spaces per indent level (PEP 8 standard).
indent_width = 4
# Continuation lines (when a statement wraps) also indent by 4.
continuation_indent_width = 4
# Don't indent the closing bracket of a multi-line call/list/dict
indent_closing_brackets = false
# DO de-indent the closing bracket — line it up with the opener.
dedent_closing_brackets = true
# Don't add 4 spaces of indent to blank lines inside functions.
indent_blank_lines = false
# Two spaces between code and the # of a trailing comment.
spaces_before_comment = 2
# No spaces around ** (power) operator: 2**3 not 2 ** 3.
spaces_around_power_operator = false
# Spaces around = in default arguments: foo(x = 1) not foo(x=1).
spaces_around_default_or_named_assign = true
# No extra space before a comma followed by a closing bracket.
space_between_ending_comma_and_closing_bracket = false
# No spaces just inside [ ] brackets: [a, b] not [ a, b ].
space_inside_brackets = false
# Spaces around colons in slices: x[1 : 5] not x[1:5].
spaces_around_subscript_colon = true
# No blank line before nested def/class.
blank_line_before_nested_class_or_def = false
# No blank line between a class and its docstring.
blank_line_before_class_docstring = false
# Two blank lines around top-level functions and classes (PEP 8).
blank_lines_around_top_level_definition = 2
# Two blank lines between top-level imports and module-level variables.
blank_lines_between_top_level_imports_and_variables = 2
# No blank line before the module docstring.
blank_line_before_module_docstring = false
# When wrapping `a and b`, put `and` at the start of the new line.
split_before_logical_operator = true
# When wrapping a function call, put the first argument on a new line.
split_before_first_argument = true
# Put each named arg on its own line when wrapping.
split_before_named_assigns = true
# Multi-line comprehensions wrap onto separate lines.
split_complex_comprehension = true
# Don't split right after the opening parenthesis.
split_before_expression_after_opening_paren = false
# Put the closing bracket on its own line when wrapping.
split_before_closing_bracket = true
# When splitting at commas, give every value its own line.
split_all_comma_separated_values = true
# But don't recursively force ALL top-level commas onto new lines.
split_all_top_level_comma_separated_values = false
# Don't merge separate brackets into one.
coalesce_brackets = false
# Each dict entry gets its own line in multi-line dicts.
each_dict_entry_on_separate_line = true
# Disallow lambdas that span multiple lines.
allow_multiline_lambdas = false
# Disallow dict keys that span multiple lines.
allow_multiline_dictionary_keys = false
# Penalty score for splitting at import names — 0 means free to split.
split_penalty_import_names = 0
# Don't try to fit an already-broken statement back onto fewer lines.
join_multiple_lines = false
# Closing bracket lines up with the visual indent of the opener.
align_closing_bracket_with_visual_indent = true
# Don't add parentheses to clarify operator precedence automatically.
arithmetic_precedence_indication = false
# Penalty for splitting after each line — yapf weighs this against rules.
split_penalty_for_added_line_split = 275
# Use spaces for indentation, never tabs (PEP 8).
use_tabs = false
# Don't split on a `.` when wrapping (so `obj.method()` stays together).
split_before_dot = false
# When the last argument in a call has a trailing comma, force a split.
split_arguments_when_comma_terminated = true
# Function names yapf treats as i18n calls — leave their args alone.
i18n_function_call = ['_', 'N_', 'gettext', 'ngettext']
# Comment markers yapf treats as i18n metadata.
i18n_comment = ['# Translators:', '# i18n:']
# Penalty for splitting comprehension iterables.
split_penalty_comprehension = 80
# Penalty for splitting right after an opening bracket.
split_penalty_after_opening_bracket = 280
# Penalty for splitting before an `if` in a ternary expression.
split_penalty_before_if_expr = 0
# Penalty for splitting before a bitwise operator.
split_penalty_bitwise_operator = 290
# Penalty for splitting before a logical operator (already lowered).
split_penalty_logical_operator = 0