Skip to content

Comments

Add strict option#73

Merged
timvink merged 5 commits intotimvink:masterfrom
polymorcodeus:add-strict-option
Jun 8, 2023
Merged

Add strict option#73
timvink merged 5 commits intotimvink:masterfrom
polymorcodeus:add-strict-option

Conversation

@polymorcodeus
Copy link
Contributor

Description

Adds support for strict config option similar to what was done for mkdocs-git-revision-date-localized-plugin.

Apologies on not building out a complete test suite - I know enough to be dangerous. Included are two mkdocs.yml however:

  • tests/basic_setup/mkdocs_complete_material_strict.yml
    • mkdocs serve -f ./tests/basic_setup/mkdocs_complete_material_strict.yml --strict
    • will fail with an uncommitted file
  • tests/basic_setup/mkdocs_complete_material_strict_false.yml
    • mkdocs serve -f ./tests/basic_setup/mkdocs_complete_material_strict_false.yml --strict
    • will warn with INFO with an uncommitted file

Rationale

Currently using this plugin with Material mkdocs Insiders, namely the Blog plugin. The Blog plugin creates a number of temporary files that I'm unable to ignore as they exist outside of the docs/ folder, though I still want to use the --strict serve option.

`mkdocs serve -f ./tests/basic_setup/mkdocs_complete_material_strict_false.yml --strict`

Build completes with INFO warning for non-committed files, e.g. temp files created by plugins
`mkdocs serve -f ./tests/basic_setup/mkdocs_complete_material_strict_false.yml --strict`

Build fails with WARNING for non-committed files, e.g. temp files created by plugins
Pass strict config to Page to change GitCommandError behavior
Copy strict flag behavior from mkdocs-git-revision-date-localized-plugin on handling INFO vs WARNING errors
@timvink timvink merged commit f59b6d0 into timvink:master Jun 8, 2023
@timvink
Copy link
Owner

timvink commented Jun 8, 2023

sorry for the extremely long wait! Great PR, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants