Add check to enforce literal syntax for Python builtin types
This check requires authors to initialize empty or zero builtin types
using the literal syntax (e.g., `{}` instead of `dict()`).
Authors may ignore this requirement for certain builtins using the
`--ignore` option.
Authors may also forbid calling `dict()` with keyword arguments
(`dict(a=1, b=2)`) using the `--no-allow-dict-kwargs` flag.
diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml
index f5b73d3..f1a901e 100644
--- a/.pre-commit-hooks.yaml
+++ b/.pre-commit-hooks.yaml
@@ -34,6 +34,15 @@
# for backward compatibility
files: ''
minimum_pre_commit_version: 0.15.0
+- id: check-builtin-literals
+ name: Check builtin type constructor use
+ description: Require literal syntax when initializing empty or zero Python builtin types.
+ entry: check-builtin-literals
+ language: python
+ types: [python]
+ # for backward compatibility
+ files: ''
+ minimum_pre_commit_version: 0.15.0
- id: check-case-conflict
name: Check for case conflicts
description: Check for files that would conflict in case-insensitive filesystems