Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: convert camelCase to snake_case (#37)
Purposes: 1. To match typical modern Python coding styles (recommended by PEP 8) 2. To prepare for argparse usage, which uses snake_case for default dests Via https://ast-grep.github.io/, with rule: ``` id: _ language: python rule: pattern: $ID kind: identifier all: - regex: '^[^A-Z]' # not PascalCase - regex: '[a-z][A-Z]' # has camelCase transition not: any: # backcompat (part of cog module API) - regex: ^sOut$ - inside: kind: attribute has: field: object regex: \.cogmodule$ # unittest methods - regex: ^assert - regex: ^setUp$ - regex: ^tearDown$ - regex: ^addCleanup$ transform: ID_SNAKE: convert: source: $ID toCase: snakeCase UNDERSCORE: replace: source: $ID replace: '^(_)?.*' by: '$1' fix: $UNDERSCORE$ID_SNAKE ``` plus manual review of all changes
- Loading branch information