Find values that are written down in more than one place
check_single_sourceDetect values like prices, emails, and phone numbers that appear in multiple files, so you can update them in one place and prevent inconsistent site data.
Instructions
Scans for values that look like a fact a visitor can act on — prices, email addresses, phone numbers, times, product codes — and reports every one that appears in more than one file.
A second copy of a value is a second value. It has not disagreed yet. The storefront this kit was built from advertised one price and charged another, because the number was typed into three files and only one of them was updated.
Pass source_of_truth to enforce the strict form: the value may appear in that one file, and anywhere else is a copy.
Preset patterns: price, email, phone, sku, time, percentage, dimension. Anything else is treated as a regular expression.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ignore | No | Folder or file names to skip. Defaults cover node_modules, .git, dist, build and friends. | |
| patterns | No | Preset names (price, email, phone, sku, time, percentage, dimension) or regular expressions. Default: price, email, phone | |
| directory | Yes | Full path to the site folder, for example /Users/brian/Sites/chess-lessons. | |
| min_files | No | How many distinct files a value must appear in before it is reported. Default 2. | |
| extensions | No | File extensions to scan. | |
| source_of_truth | No | Path, relative to the site folder, of the one file allowed to hold these values. Every match elsewhere becomes a problem. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fix | No | ||
| why | No | ||
| tool | Yes | Which tool produced this. | |
| status | Yes | pass = checked and clean. fail = checked and found problems. skipped = nothing was measured. error = the tool could not run. | |
| problem | No | ||
| headline | Yes | One sentence verdict, safe to show a non-technical user. | |
| patterns | No | ||
| directory | No | ||
| inventory | No | ||
| duplicates | No | ||
| error_code | No | Set only when status is "error". | |
| files_scanned | No | ||
| source_of_truth | No | ||
| copies_outside_source | No |