Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MsBuild syntax for setting warnings easily #10882

Closed
baronfel opened this issue Jan 15, 2021 · 0 comments · Fixed by #10885
Closed

Support MsBuild syntax for setting warnings easily #10882

baronfel opened this issue Jan 15, 2021 · 0 comments · Fixed by #10885
Labels
Area-ProjectsAndBuild MSBuild tasks, project files, framework resolution Feature Request
Milestone

Comments

@baronfel
Copy link
Member

Right now there's a lot of overhead to adding --warnon values to a project's compilation. The current syntax requires a user to do something like

<OtherFlags>$(OtherFlags) --warnon:`warningNumber`</OtherFlags>

for each warning they want to set, especially if they have multiple warnings and want do document what each is added for.

This is error prone, because a user has to:

  • remember to insert any previous flags (or else they will be overwritten
  • remember --warnon syntax

Describe the solution you'd like
I'd like for syntax like <WarnOn>warningNumber</WarnOn> to be supported in the F# MsBuild targets and Fsc task.

This syntax would allow for multiple-definitions of WarnOn and roll each definition up into a final list, which would make it easy to add and comment specific warnings.
It would also be easy to add warnings to the compiler at the targets level instead of baking them into the compiler, if that was desired (see the new 33390 xml validation errors/warnings) as an example.

Describe alternatives you've considered
Keep the status quo.

Additional context
Initially brought up here, but I've been wanting this for ages

KevinRansom added a commit to KevinRansom/fsharp that referenced this issue Jan 15, 2021
@cartermp cartermp added the Area-ProjectsAndBuild MSBuild tasks, project files, framework resolution label Jan 16, 2021
@cartermp cartermp added this to the Backlog milestone Jan 16, 2021
KevinRansom added a commit that referenced this issue Jan 21, 2021
* fixes #10882

* Fix tests

* fix warnon

* Feedback + tests
@cartermp cartermp modified the milestones: Backlog, 16.10 Feb 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-ProjectsAndBuild MSBuild tasks, project files, framework resolution Feature Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants