rust-lang/rustfmt

Option to ignore modules that cannot be resolved

Open

#5,609 创建于 2022年11月18日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)Rust (4,893 star) (760 fork)batch import
C-feature-requestP-lowgood first issue

描述

Hi

I am working on async-stripe which generates rust files and run into frequent errors in my automatic CI pipeline when they (the upstream openapi) remove parts of the api surface, as those modules are still referenced in the manual written mod.rs files. The automatic codegen runs, rustfmt is applied, and it fails due to missing files.

Now, I could (and will in the mean time) just set the rustfmt step as optional and apply it manually as these cases need to be manually intercepted, but I would love it if that, rather than eagerly fail, there was an opt-in option to simply prune the modules that now no-longer exist such that it can recover and format the ones that do.

Formatting is then also checked in the subsequent PR that is generated, but it would be nice to have the PR be created with formatting applied at a best-effort level.

See https://github.com/arlyon/async-stripe/actions/runs/3493571680/jobs/5848542195

Cheers,

Alex

贡献者指南

Option to ignore modules that cannot be resolved · rust-lang/rustfmt#5609 | Good First Issue