aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Feature Request] move-compiler needs a general way to select classes of warnings shown

Open brmataptos opened this issue 1 year ago • 2 comments

🚀 Feature Request

We have one flag to suppress one kind of warnings: "skip_attribute_checks", defined in Flags in aptos-core/third_party/move/move-compiler/src/shared/mod.rs, but as I consider adding a flag for deprecation warnings this seems not very scalable.

Another option for warnings would be a new mechanism that is interpreted in the diagnostics module in aptos-core/third_party/move/move-compiler/src/diagnostics/mod.rs.

I note that whatever we use should also work with compiler_v2., which is using the move-model mechanism, implemented in GlobalEnv in aptos-core/third_party/move/move-model/src/model.rs; for example, see the method GlobalEnv::report_diag_with_filter().

Motivation

Deciding which warnings to show should be cleaner in the code.

Pitch

No clear ideas yet.

brmataptos avatar Oct 07 '23 23:10 brmataptos

I think we should really go with the standard solution here you find in many other languages — attributes which control other attributes. Like an attribute to declare an attribute, an attribute to suppress a warning, etc. Lets do this right for v2 and for v1 only absolutely required minimum.

On Sat, Oct 7, 2023 at 4:22 PM Brian R. Murphy @.***> wrote:

🚀 Feature Request

We have one flag to suppress one kind of warnings: "skip_attribute_checks", defined in Flags in aptos-core/third_party/move/move-compiler/src/shared/mod.rs, but as I consider adding a flag for deprecation warnings this seems not very scalable.

Another option for warnings would be a new mechanism that is interpreted in the diagnostics module in aptos-core/third_party/move/move-compiler/src/diagnostics/mod.rs.

I note that whatever we use should also work with compiler_v2., which is using the move-model mechanism, implemented in GlobalEnv in aptos-core/third_party/move/move-model/src/model.rs; for example, see the method GlobalEnv::report_diag_with_filter(). Motivation

Deciding which warnings to show should be cleaner in the code. Pitch

No clear ideas yet.

— Reply to this email directly, view it on GitHub https://github.com/aptos-labs/aptos-core/issues/10439, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2MSOXX4624MBN4526Q2LDX6HP4PAVCNFSM6AAAAAA5XHSRIWVHI2DSMVQWIX3LMV43ASLTON2WKOZRHEZTCNJUGQZDCNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

wrwg avatar Oct 08 '23 02:10 wrwg

We have several situations where V2 can generate a lot of warnings on a line. We should do this for V2. maybe attributes.

brmataptos avatar May 11 '24 01:05 brmataptos