feature: support strict configuration option (#840)

Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
This commit is contained in:
Timothée Mazzucotelli
2026-08-04 12:03:32 +02:00
committed by GitHub
parent 71c5ed5bff
commit 6227f4e52f
3 changed files with 6 additions and 1 deletions
+2
View File
@@ -62,6 +62,8 @@ pub struct Project {
pub site_dir: String,
/// Whether to use directory URLs.
pub use_directory_urls: bool,
/// Whether to abort the build on any warnings.
pub strict: bool,
/// Development server address.
pub dev_addr: String,
/// Copyright notice.
+3 -1
View File
@@ -185,7 +185,9 @@ fn run(config_file: &PathBuf, mode: Mode) -> PyResult<bool> {
// Determine if strict mode is enabled
let strict = match &mode {
Mode::Build(options) => options.strict.unwrap_or(false),
Mode::Build(options) => {
options.strict.unwrap_or(false) || config.project.strict
}
Mode::Serve(_, _) => false,
};
+1
View File
@@ -411,6 +411,7 @@ def _apply_defaults(config: dict, path: str) -> dict:
set_default(config, "site_description", None, str)
set_default(config, "site_author", None, str)
set_default(config, "use_directory_urls", True, bool)
set_default(config, "strict", False, bool)
set_default(config, "dev_addr", "localhost:8000", str)
set_default(config, "copyright", None, str)
set_default(config, "watch", [], list)