Configure linter to forbid use of html/template (#21307)

* Configure linter to forbid use of html/template

We should never use html/template due to the performance penalty and the fact that we are highly unlikely to ever be generating HTML templates.

* Link to PR explaining the format of forbidigo.forbid
This commit is contained in:
Nathan Coleman 2024-06-11 15:17:12 -05:00 committed by GitHub
parent 963cee200b
commit 14e409ef54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -75,7 +75,9 @@ linters-settings:
simplify: true
forbidigo:
# Forbid the following identifiers (list of regexp).
# Format includes custom message based on https://github.com/ashanbrown/forbidigo/pull/11
forbid:
- '\bhtml\/template\b(# Use text/template instead)?'
- '\bioutil\b(# Use io and os packages instead of ioutil)?'
- '\brequire\.New\b(# Use package-level functions with explicit TestingT)?'
- '\bassert\.New\b(# Use package-level functions with explicit TestingT)?'