Check Python files for repeat use of strings

Escape commas with \\ (\ when enclosed in single quotes)

Defaults can be configured in your pyproject.toml file

Installation

$ pip install constcheck

pre-commit

constcheck can be used as a pre-commit hook

It can be added to your .pre-commit-config.yaml as follows:

repos:
  - repo: https://github.com/jshwi/constcheck
    rev: v0.7.0
    hooks:
      - id: constcheck
        args:
          - "--count=3"
          - "--length=3"