Skip to content

Commit

Permalink
Add mypy configuration and add missing types
Browse files Browse the repository at this point in the history
  • Loading branch information
153957 committed Jun 4, 2023
1 parent ed3c547 commit 26fd851
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pelicanconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

PATH = 'content'
PAGE_PATHS = ['']
STATIC_PATHS = []
STATIC_PATHS: list[str] = []

TIMEZONE = 'UTC'
DEFAULT_LANG = 'en'
Expand Down Expand Up @@ -71,7 +71,7 @@


# No blog, just pages!
ARTICLE_PATHS = []
ARTICLE_PATHS: list[str] = []
ARTICLE_URL = False
ARTICLE_SAVE_AS = False
ARCHIVES_SAVE_AS = False
Expand Down
2 changes: 1 addition & 1 deletion plugins/shortcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
SETTINGS_NAME = 'SHORTCODES'


def replace_shortcode(group: re.Match, shortcodes: dict[str, str]) -> str:
def replace_shortcode(group: re.Match[str], shortcodes: dict[str, str]) -> str:
"""Replace shortcodes with evaluated templates"""
match = group.groups()[0]
code, _, args = match.partition(' ')
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ section-order = [

[tool.ruff.isort.sections]
pelican = ['pelican']

[tool.mypy]
ignore_missing_imports = true
show_column_numbers = true
show_error_codes = true
strict = true
warn_return_any = true
warn_unused_configs = true

0 comments on commit 26fd851

Please sign in to comment.