-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script to help find undocumented settings
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: dart_code_website | ||
|
||
dependencies: | ||
path: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'dart:convert'; | ||
import 'dart:io'; | ||
import 'package:path/path.dart'; | ||
|
||
main() { | ||
Directory.current = dirname(Platform.script.toFilePath()); | ||
|
||
final packageFile = File('../../Dart-Code/package.json'); | ||
final packageManifest = jsonDecode(packageFile.readAsStringSync()); | ||
final Map<String, dynamic> configOptions = | ||
packageManifest['contributes']['configuration']['properties']; | ||
|
||
validateSettingsDoc(configOptions); | ||
} | ||
|
||
void validateSettingsDoc(Map<String, dynamic> configOptions) { | ||
final settingsFile = File('../_docs/settings.md'); | ||
final settingsContent = settingsFile.readAsStringSync(); | ||
|
||
configOptions.forEach((name, options) { | ||
if (!settingsContent.contains('## $name')) { | ||
print('Setting $name does not appear in docs!'); | ||
} | ||
}); | ||
} |