aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
6.07k stars 3.61k forks source link

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

Open brmataptos opened 11 months ago

brmataptos commented 11 months ago

🚀 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.

wrwg commented 11 months ago

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: @.***>

brmataptos commented 4 months ago

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