Make public/rules-swift the canonical source (per project direction) and adopt its opt-in lint rules that PureXML lacked: empty_count, explicit_init, first_where, sorted_first_last, unused_import, plus its todo disable. All pass with zero violations on the existing sources. PureXML keeps its coherent, stricter tuning where the canon is a self-described 'starting point': force_unwrapping/force_try/force_cast = error (safety), and trailing commas mandated in both swiftformat (--commas always) and swiftlint (mandatory_comma) to resolve the canon's formatter-adds vs linter-flags mismatch. docs/rules/README.md now points at public/rules-swift and documents the tuning.
31 lines
912 B
YAML
31 lines
912 B
YAML
# Mechanical enforcement of the code rules a machine can decide
|
|
# (engineering.md principle: no force-unwrap in shipping code).
|
|
#
|
|
# Inert until Swift sources exist. The CI workflow that runs swiftlint plus
|
|
# build plus test ships with the engine package.
|
|
opt_in_rules:
|
|
- force_unwrapping
|
|
# Adopted from the canonical rules-swift opt-in set.
|
|
- empty_count
|
|
- explicit_init
|
|
- first_where
|
|
- sorted_first_last
|
|
- unused_import
|
|
disabled_rules:
|
|
# Suggests Foundation's String(bytes:encoding:); PureXML is Foundation-free, so
|
|
# String(decoding:as:) from the standard library is the correct conversion.
|
|
- optional_data_string_conversion
|
|
# rules-swift disables todo; PureXML tracks TODOs in issues, not the linter.
|
|
- todo
|
|
excluded:
|
|
- .build
|
|
- DerivedData
|
|
force_unwrapping: error
|
|
force_try: error
|
|
force_cast: error
|
|
line_length:
|
|
warning: 180
|
|
error: 180
|
|
trailing_comma:
|
|
mandatory_comma: true
|