From b9d7b8736062509f1f7a5c02943398975ea7ee53 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 21 Jul 2026 16:56:39 +0800 Subject: feat(lint): add non_mingling_naming_style lint with auto-fix suggestions Support file-level lint checks via `check_file` in lint registry template. --- mingling_cli/pre/lint_registry.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mingling_cli/pre') diff --git a/mingling_cli/pre/lint_registry.rs b/mingling_cli/pre/lint_registry.rs index 09d67f9..e69592b 100644 --- a/mingling_cli/pre/lint_registry.rs +++ b/mingling_cli/pre/lint_registry.rs @@ -43,6 +43,22 @@ pub fn gen_mod_file() -> Result<(), Error> { }) } + // Generate file-level lint calls (lints that have `pub fn check_file`) + for name in &entries { + let file_path = lints_dir.join(format!("{name}.rs")); + let has_check_file = fs::read_to_string(&file_path) + .map(|c| c.contains("pub fn check_file(")) + .unwrap_or(false); + if has_check_file { + tmpl!(template, file_calls { + name = name + }); + tmpl!(template, file_lints { + name = name + }); + } + } + fs::write(&mod_file, template.to_string())?; Ok(()) -- cgit