github-pages-template icon indicating copy to clipboard operation
github-pages-template copied to clipboard

Add dirty words checker

Open fulldecent opened this issue 11 months ago • 0 comments

Add a script to test the build pages.

It must work on the entire file as a string and match regexpes against that.

Configure the regexps using a .dirty-words.json file.

Default config:

[
    {
        "regexp": "\\?utm_source=chatgpt.com",
        "severity": "error",
        "ignoreCase": true,
        "note": "Copied a link from Chat GPT without reviewing it"
    },
    {
        "regexp": "<\\s*title\\s*>[^<]*\\&amp;amp;[^<]*",
        "severity": "error",
        "ignoreCase": true,
        "note": "Double-escaped HTML quoting"
    },
    {
        "regexp": "href\\s*=\\s*\"[^:]+\\.htm[l]?\"",
        "severity": "error",
        "ignoreCase": true,
        "note": "Linking to an HTML without using extensionless"
    }
]

fulldecent avatar Feb 11 '25 15:02 fulldecent