Page MenuHomePhabricator

Use strict types everywhere in Wikibase
Open, LowPublic

Description

Estimation of completion (note: requires Bash, not Zsh or other sh):

done=$(grep --exclude-dir={vendor,node_modules,.idea,.phan} --include=\*.php -rwl . -e strict_types | wc -l) &&
todo=$(grep --exclude-dir={vendor,node_modules,.idea,.phan} --include=\*.php -rwl . -e . | wc -l) &&
percent=$(bc <<< "scale=5; 100 * $done / $todo") &&
head=$(git -c core.abbrev=10 rev-parse --short HEAD) &&
LC_ALL=C printf '* %(%d %B %Y)T (%s) = %d/%d = %1.2f%%\n' -1 "$head" "$done" "$todo" "$percent"

Event Timeline

Change 592297 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/Wikibase@master] Add ADR for rollout of declare( strict_types = 1 );

https://gerrit.wikimedia.org/r/592297

On the campsite for the ADR review period.

hoo renamed this task from Use strict types everywhere in WIkibase to Use strict types everywhere in Wikibase.Apr 30 2020, 11:23 PM

Change 592297 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add ADR for rollout of declare( strict_types = 1 );

https://gerrit.wikimedia.org/r/592297

Addshore updated the task description. (Show Details)

I updated the shell script in the task description to directly print a new line for the estimation list, but didn’t change the “todo” and “done” commands. But doesn’t this underestimate the real progress if the “done” command excludes several directories, but the “todo” command doesn’t?

Edit: after rm -rf vendor/, I get instead:

  • 15 July 2020 = 151/1744 = 8.00%

Updated the script and the outputs so that “todo” and “done” both consider the same set of files. (I wasn’t able to find a commit where we had two strict_types declarations – we went from one in aca4c86cbe to five in 7eebaa5e52 as far as I can tell – but for the other days, the number of done files matched up.)