{"id":20954570,"url":"https://github.com/duolingo/pre-commit-hooks","last_synced_at":"2025-04-09T15:06:53.809Z","repository":{"id":35474395,"uuid":"211048207","full_name":"duolingo/pre-commit-hooks","owner":"duolingo","description":"Standardizing our code quality tooling :hammer_and_wrench:","archived":false,"fork":false,"pushed_at":"2025-04-08T00:23:43.000Z","size":512,"stargazers_count":65,"open_issues_count":7,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-09T15:06:46.843Z","etag":null,"topics":["black","formatter","git","google-java-format","ktlint","pre-commit","prettier","scalafmt","shfmt","svgo","terraform"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duolingo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-26T09:12:07.000Z","updated_at":"2025-04-01T19:38:32.000Z","dependencies_parsed_at":"2023-01-15T21:49:20.584Z","dependency_job_id":"72a57571-f88c-4d57-9fc7-3d72918a6a42","html_url":"https://github.com/duolingo/pre-commit-hooks","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fpre-commit-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fpre-commit-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fpre-commit-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duolingo%2Fpre-commit-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duolingo","download_url":"https://codeload.github.com/duolingo/pre-commit-hooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055284,"owners_count":21040157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["black","formatter","git","google-java-format","ktlint","pre-commit","prettier","scalafmt","shfmt","svgo","terraform"],"created_at":"2024-11-19T01:15:13.661Z","updated_at":"2025-04-09T15:06:53.784Z","avatar_url":"https://github.com/duolingo.png","language":"JavaScript","readme":"# pre-commit hooks\n\nThis repo currently contains a single [pre-commit](https://pre-commit.com/) hook that internally runs several code formatters in parallel.\n\n- [Prettier](https://github.com/prettier/prettier) v3.3.3 for CSS, HTML, JS, JSX, Markdown, Sass, TypeScript, XML, YAML\n- [Ruff](https://docs.astral.sh/ruff/) v0.7.3 for Python 3\n- [Black](https://github.com/psf/black) v21.12b0 for Python 2\n- [autoflake](https://github.com/myint/autoflake) v1.7.8 for Python \u003c!-- TODO: Upgrade to v2+, restrict to Python 2, and reenable Ruff rule F401 once our Python 3 repos that were converted from Python 2 no longer use type hint comments: https://github.com/PyCQA/autoflake/issues/222#issuecomment-1419089254 --\u003e\n- [isort](https://github.com/PyCQA/isort) v5.13.2 for Python 2\n- [google-java-format](https://github.com/google/google-java-format) v1.24.0 for Java\n- [ktfmt](https://github.com/facebookincubator/ktfmt) v0.53 for Kotlin\n- [gofmt](https://pkg.go.dev/cmd/gofmt) v1.23.3 for Go\n- [scalafmt](https://scalameta.org/scalafmt/) v3.8.3 for Scala\n- [shfmt](https://github.com/mvdan/sh) v3.10.0 for Shell\n- [xsltproc](http://www.xmlsoft.org/xslt/xsltproc.html) from libxslt v10139 for XML\n- [terraform fmt](https://github.com/hashicorp/terraform) v1.9.8 for Terraform\n- [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) v18.1.8 for C++, Protobuf\n- [SVGO](https://github.com/svg/svgo) v3.3.2 for SVG\n- [Taplo](https://taplo.tamasfe.dev/) v0.9.3 for TOML\n- Custom regex transformations (basically [sed](https://en.wikipedia.org/wiki/Sed)), for example:\n  - Trimming trailing whitespace and newlines\n  - Removing unnecessary `coding` pragmas and `object` base classes in Python 3\n  - Replacing empty Python collections like `list()` with literal equivalents\n  - Replacing empty Kotlin collections like `arrayOf()` with `empty` equivalents\n\nWe run this hook on developer workstations and enforce it in CI for all production repos at Duolingo.\n\n## Usage\n\nRepo maintainers can declare this hook in `.pre-commit-config.yaml`:\n\n```yaml\n- repo: https://github.com/duolingo/pre-commit-hooks.git\n  rev: 1.8.2\n  hooks:\n    - id: duolingo\n      args: # Optional\n        - --python-version=2 # Defaults to Python 3\n        - --scala-version=3 # Defaults to Scala 2.12\n```\n\nDirectories named `build` and `node_modules` are excluded by default - no need to declare them in the hook's `exclude` key.\n\nContributors can copy or symlink this repo's `.editorconfig` file to their home directory in order to have their [text editors and IDEs](https://editorconfig.org/) automatically pick up the same linter/formatter settings that this hook uses.\n\n_Duolingo is hiring! Apply at https://www.duolingo.com/careers_\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduolingo%2Fpre-commit-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduolingo%2Fpre-commit-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduolingo%2Fpre-commit-hooks/lists"}