-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(null): add yarn null:progress (#3033)
#### Description of changes This implements a new script that generates a progress message for use with our standup dashboard. `yarn null:progress` emits stdout like this: ```markdown ## Web strict-null progress **29%** complete (**387**/1328 non-test files) *Contribute at [#2869](#2869). Last update: Mon Jul 06 2020* ``` ...which renders in the dashboard widget like this: ![screenshot of above output as-rendered in dashboard](https://user-images.githubusercontent.com/376284/86670541-9a75a180-bfa9-11ea-99f2-730038d68a71.png) #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [x] Addresses an existing issue: #2869 - [x] Ran `yarn fastpass` - [n/a] Added/updated relevant unit test(s) (and ran `yarn test`) - [n/a] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage` - [x] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See `CONTRIBUTING.md`. - [n/a] (UI changes only) Added screenshots/GIFs to description above - [n/a] (UI changes only) Verified usability with NVDA/JAWS
- Loading branch information
Showing
3 changed files
with
38 additions
and
6 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
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,24 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
// @ts-check | ||
const { repoRoot } = require('./config'); | ||
const { getCheckedFiles, forEachFileInSrc } = require('./eligible-file-finder'); | ||
|
||
async function main() { | ||
const datestamp = new Date().toDateString(); | ||
const doneCount = (await getCheckedFiles(repoRoot)).size; | ||
const totalCount = (await forEachFileInSrc(`${repoRoot}/src`)).length; | ||
const percentage = 100 * (doneCount / totalCount); | ||
const formattedPercentage = percentage.toFixed(0) + '%'; | ||
|
||
console.log(`## Web strict-null progress\n`); | ||
console.log( | ||
`**${formattedPercentage}** complete (**${doneCount}**/${totalCount} non-test files)\n`, | ||
); | ||
console.log( | ||
`*Contribute at [#2869](https://github.com/microsoft/accessibility-insights-web/issues/2869). Last update: ${datestamp}*`, | ||
); | ||
} | ||
|
||
main(); |