Standardizing our code quality tooling :hammer_and_wrench:
This repo currently contains a single pre-commit hook that internally runs several code formatters in parallel.
coding
pragmas and object
base classes in Python 3list()
with literal equivalentsarrayOf()
with empty
equivalentsWe run this hook on developer workstations and enforce it in CI for all production repos at Duolingo.
Repo maintainers can declare this hook in .pre-commit-config.yaml
:
- repo: https://github.com/duolingo/pre-commit-hooks.git
rev: 1.7.3
hooks:
- id: duolingo
args: # Optional
- --python-version=2 # Defaults to Python 3
- --scala-version=3 # Defaults to Scala 2.12
Directories named build
and node_modules
are excluded by default - no need to declare them in the hook's exclude
key.
Contributors can copy or symlink this repo's .editorconfig
file to their home directory in order to have their text editors and IDEs automatically pick up the same linter/formatter settings that this hook uses.
Duolingo is hiring! Apply at https://www.duolingo.com/careers