File tree 3 files changed +17
-2
lines changed
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change
1
+ dub will now warn on unrecognized settings or selections file
2
+
3
+ Previously, dub was silently accepting anything it didn't recognize
4
+ in `[dub.]settings.json` and `dub.selections.json`. While the original
5
+ intent was to make forward-compatibility easy, it proved detrimental
6
+ as typos would just mean the user setting was ignored.
7
+
8
+ From this release, dub will now warn about any entry in its configuration files
9
+ or in `dub.selections.json`. After 10 releases, those warnings will turn into errors.
Original file line number Diff line number Diff line change @@ -267,10 +267,13 @@ class Dub {
267
267
268
268
void readSettingsFile (NativePath path_)
269
269
{
270
+ // TODO: Remove `StrictMode.Warn` after v1.40 release
271
+ // The default is to error, but as the previous parser wasn't
272
+ // complaining, we should first warn the user.
270
273
const path = path_.toNativeString();
271
274
if (path.exists)
272
275
this .m_config = this .m_config.merge(
273
- parseConfigFile! UserConfiguration(CLIArgs(path)));
276
+ parseConfigFile! UserConfiguration(CLIArgs(path), StrictMode.Warn ));
274
277
}
275
278
276
279
const dubFolderPath = NativePath(thisExePath).parentPath;
Original file line number Diff line number Diff line change @@ -79,7 +79,10 @@ class Project {
79
79
80
80
auto selverfile = (m_rootPackage.path ~ SelectedVersions.defaultFile).toNativeString();
81
81
if (existsFile(selverfile)) {
82
- auto selected = parseConfigFileSimple! Selected(selverfile);
82
+ // TODO: Remove `StrictMode.Warn` after v1.40 release
83
+ // The default is to error, but as the previous parser wasn't
84
+ // complaining, we should first warn the user.
85
+ auto selected = parseConfigFileSimple! Selected(selverfile, StrictMode.Warn);
83
86
enforce(! selected.isNull(), " Could not read '" ~ selverfile ~ " '" );
84
87
m_selections = new SelectedVersions(selected.get ());
85
88
} else m_selections = new SelectedVersions;
You can’t perform that action at this time.
0 commit comments