Closed vergenzt closed 4 months ago
Purposes:
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
The ast-grep rule is impressive. I was a little worried about setOutput used in the doc generation, but I don't seem to be using it anywhere else, so probably no one else is either.
setOutput
Thanks!
Purposes:
Via https://ast-grep.github.io/, with rule:
plus manual review of all changes