-
Notifications
You must be signed in to change notification settings - Fork 787
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
Show default value of compiler options #18054
base: main
Are you sure you want to change the base?
Conversation
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
--warnaserror[+|-] Report all warnings as errors | ||
--warnaserror[+|-]:<warn;...> Report specific warnings as errors | ||
--warnaserror[+|-] Report all warnings as errors (off by default) | ||
--warnaserror[+|-]:<warn;...> Report specific warnings as errors (off by default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default is an empty delimited list.
Plus means to report warnings as errors.
Minus should mean to exclude from the global (just above) warn as error feature.
Thank you for the first contribution. The default value for each switch can change over time (and it does), and is not only done so via .fs code in the compiler project itself, the default can also be specified in the respective Fsc and Fsi msbuild build tasks. This makes a hardcoded selection of defaults, directly as text, prone to mismatches when settings are changed. Even more so when immediate changes of values can happen as a consequence of issues that need immediate fixing. This then resurfaces one more time as a result of tests needing a change every time a value changes it's defaultness as well. The fact of settings being a "living" artefact that changes over time and the situation of being override-able at more levels (compiler project, Fsc/Fsi build task, xml config in .net sdk targets) makes a human-managed text easy to get wrong as time passes. Another small, but acceptable, downside is that every text has to be localized for every supported language. And text needing review / retranslation, even if small suffix like "default:true" is added or when the default gets changed. I think this only makes sense for acceptance if it can be fully automated and will not get in the way of changing values |
+1 to what Tomáš wrote, hardcoding defaults for what they are at this point in time will bring more desynchronisation, ideally we want to generate them from the actual defaults in code (which might require a redoing how flags are parsed/stored). |
I think this is decent improvement to the command line compiler. It does make the things the compiler does a bit clearer. It is fair to say that the way this feature is tested is a lot dependent on the console output and is thus sensitive to spelling corrections, additional options and text changes, but that is what the feature is. As for translation, the repo is set up to make it as easy as possible for our translation partners to make those changes. So we would always take change that improve clarity. |
If the F# compiler is meant to be a product, then there must be documentation for the flag defaults. For both fsc and the build task. And every change of the default value must be documented and tested, also in "urgent" cases. Therefore, I like very much that this contribution makes an attempt to provide such documentation. |
Yes, however it's "hard-coded" here in the message itself, meaning when you change default for the given option, documentation won't reflect it, and one will need to go and change documentation, every single translation, change help baseline tests (and they won't be failing either if the default is changed accidentally). Default values should be auto-generated from actual default values. But this will require change in how compiler options are organised. This will allow us to easier change defaults, and will prevent changing it accidentally, since baseline tests will start failing. |
Thanks for the feedbacks, @T-Gro is right this should be auto generated, I did this way because I saw |
Description
Fixes #16294
I used the following files as reference to get the default values:
Unfortunately I could not make the
Help - variant
tests pass because of a generation mismatch on--delaysign
and--realsig
, I need a little bit of help on thisChecklist
Test cases added
Performance benchmarks added in case of performance changes
Release notes entry updated: