Last modified: 2013-02-11 10:43:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44628, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42628 - fail on whitespace error in submitted files
fail on whitespace error in submitted files
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Antoine "hashar" Musso (WMF)
:
Depends on:
Blocks: 35585
  Show dependency treegraph
 
Reported: 2012-12-02 17:17 UTC by Antoine "hashar" Musso (WMF)
Modified: 2013-02-11 10:43 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2012-12-02 17:17:24 UTC
We try to avoid trailing whitespaces in files but do not enforce it for now. git comes with a whitespace checker : git diff --check, which will fail whenever files in the commit introduce trailing spaces.

We need to run 'git diff --check' in the universal linter.
Comment 1 Antoine "hashar" Musso (WMF) 2012-12-10 10:19:17 UTC
For Mediawiki core and extensions: https://gerrit.wikimedia.org/r/37803
Comment 2 Antoine "hashar" Musso (WMF) 2012-12-21 14:35:33 UTC
I have amended above change which was faulty and also forced color usage. An example console output is https://integration.mediawiki.org/ci/job/mediawiki-core-lint/2204/console (link not permanent) which show:

14:26:57 + git --work-tree=/var/lib/jenkins/jobs/mediawiki-core-lint/workspace diff --color --check 'HEAD^..HEAD'
14:26:57 whitespace.php:2: trailing whitespace.
14:26:57 +echo "I got trailing space";XXXXX
14:26:57 Build step 'Execute shell' marked build as failure
14:26:57 Finished: FAILURE

(where XXXXX is a placeholder for 5 whitespaces and are shown red in the console).


Have applied it in production to the mediawiki-core-lint job. Will deploy for other repositories later on.
Comment 3 Antoine "hashar" Musso (WMF) 2012-12-21 16:02:49 UTC
I have removed the whitespace check on 'mediawiki-core-lint' since there are some case where we might actually need trailing whitespaces.

We want the whitespace check to be a different Jenkins job that would not block on failure (non-voting in Zuul).
Comment 4 Antoine "hashar" Musso (WMF) 2013-01-07 18:58:59 UTC
https://gerrit.wikimedia.org/r/#/c/37803/ does whitespace check on mediawiki/core and mediawiki extensions
Comment 5 Antoine "hashar" Musso (WMF) 2013-01-07 21:23:27 UTC
Raymond reported to me an issue with a legitimate change that got rejected because of the whitespace check : https://gerrit.wikimedia.org/r/#/c/42601/  that introduce a message file with a trailing whitespace :-]

https://gerrit.wikimedia.org/r/42672 moves the whitespace check of the -lint jobs 
 to new -whitespaces jobs which can then be made non voting in Zuul.
Comment 6 Antoine "hashar" Musso (WMF) 2013-01-07 21:41:31 UTC
I have made whitespace jobs to be non voting by default : https://gerrit.wikimedia.org/r/42677 

Then added a whitespace check in mediawiki core with https://gerrit.wikimedia.org/r/42678
Comment 7 Matthew Flaschen 2013-01-31 08:05:10 UTC
Can this also fail if a PHP file starts with whitespace?  Let me know if you prefer I file a separate bug.
Comment 8 Antoine "hashar" Musso (WMF) 2013-02-11 10:43:27 UTC
We have the whitespace job in Jenkins now though it does not vote because there is a lot of corner case where it would provide false positives.  So that is just giving a hint :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links