Skip to content

Commit

Permalink
Add pyupgrade pre-commit hook (#665)
Browse files Browse the repository at this point in the history
* Add pyupgrade pre-commit hook

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
adamchainz and pre-commit-ci[bot] authored Aug 4, 2021
1 parent 2cd8b4f commit d539538
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ repos:
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v2.23.1
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/psf/black
rev: 21.7b0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions src/corsheaders/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def check_settings(app_configs, **kwargs):
allow_all_alias = "CORS_ORIGIN_ALLOW_ALL"
errors.append(
checks.Error(
"{} should be a bool.".format(allow_all_alias),
f"{allow_all_alias} should be a bool.",
id="corsheaders.E005",
)
)
Expand All @@ -71,7 +71,7 @@ def check_settings(app_configs, **kwargs):
if not is_sequence(conf.CORS_ALLOWED_ORIGINS, str):
errors.append(
checks.Error(
"{} should be a sequence of strings.".format(allowed_origins_alias),
f"{allowed_origins_alias} should be a sequence of strings.",
id="corsheaders.E006",
)
)
Expand Down

0 comments on commit d539538

Please sign in to comment.