It should be 4 spaces... I found where the default is set, here's a quick untested patch with no configurability. You can also change your personal preferences under Differences -> Preferences
diff --git a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/AccountDiffPreference.java b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/AccountDiffPreference.java index 3b04725..5c689aa 100644 --- a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/AccountDiffPreference.java +++ b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/AccountDiffPreference.java @@ -58,7 +58,7 @@ public class AccountDiffPreference { public static AccountDiffPreference createDefault(Account.Id accountId) { AccountDiffPreference p = new AccountDiffPreference(accountId); p.setIgnoreWhitespace(Whitespace.IGNORE_NONE); - p.setTabSize(8); + p.setTabSize(4); p.setLineLength(100); p.setSyntaxHighlighting(true); p.setShowWhitespaceErrors(true);
On Wed, Aug 8, 2012 at 10:29 AM, Adam Wight awight@wikimedia.org wrote:
It should be 4 spaces... I found where the default is set, here's a quick untested patch with no configurability. You can also change your personal preferences under Differences -> Preferences
diff --git a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/AccountDiffPreference.java b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/AccountDiffPreference.java index 3b04725..5c689aa 100644
a/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/AccountDiffPreference.java +++ b/gerrit-reviewdb/src/main/java/com/google/gerrit/reviewdb/client/AccountDiffPreference.java @@ -58,7 +58,7 @@ public class AccountDiffPreference { public static AccountDiffPreference createDefault(Account.Id accountId) { AccountDiffPreference p = new AccountDiffPreference(accountId); p.setIgnoreWhitespace(Whitespace.IGNORE_NONE);
- p.setTabSize(8);
- p.setTabSize(4); p.setLineLength(100); p.setSyntaxHighlighting(true); p.setShowWhitespaceErrors(true);
We're not deploying custom hacks like this to our Gerrit installation--we want to use the vanilla installation as much as humanly possible.
If the default user pref should be configurable, then that's an issue for upstream.
Also, "it should be 4 spaces" is a matter of opinion--everyone likes different tab widths depending on their preferences and monitor size.
-Chad
Also, "it should be 4 spaces" is a matter of opinion--everyone likes
different tab widths depending on their preferences and monitor size.
To prove his point, I'm personally partial to 2 spaces and have all of my editors set up accordingly.
Thank you, Derric Atzrott Computer Specialist
Also, "it should be 4 spaces" is a matter of opinion--everyone likes different tab widths depending on their preferences and monitor size.
http://www.mediawiki.org/wiki/CC#Tab_size
"you should make no assumptions" appears to support Chad's statement. However, I'm pretty sure that in reality, many people assume a width of 4. I've definitely seen funky tab-plus-space indentations that support that theory.
On 08/08/2012 11:07 AM, Mark Holmquist wrote:
Also, "it should be 4 spaces" is a matter of opinion--everyone likes different tab widths depending on their preferences and monitor size.
http://www.mediawiki.org/wiki/CC#Tab_size
"you should make no assumptions" appears to support Chad's statement. However, I'm pretty sure that in reality, many people assume a width of 4. I've definitely seen funky tab-plus-space indentations that support that theory.
I officially redact my bogus claim that it "should" be 4 spaces. However, we certainly shouldn't default to 8!
(moral authority provided by: Cleric: And the Lord spake, saying, "First shalt thou take out the Holy Pin. Then shalt thou count to three, no more, no less. Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. *Five is right out.* Once the number three, being the third number, be reached, then lobbest thou thy Holy Hand Grenade of Antioch towards thy foe, who, being naughty in my sight, shall snuff it.)
I've always wondered about something:
Given the 2 rules:
- "Lines should be broken at between 80 and 100 columns."[1] - "You should make no assumptions about the number of spaces per tab."[2]
I have a couple of questions:
- What should we do if someone who uses 1 space tabs writes a 99 character line (including the tab)? - If you are using more than 1 space per tab, you they are breaking the 100 column rule. - What should we do if someone who uses 8 space tabs tells you that you are breaking the 100 column rule? - If you are using less than 8 spaces per tab, than you aren't breaking the 100 column rule.
I get why there's no value in starting a holy war over spaces-per tab, but this is a good example of why it's also a problem to not make a decision one way or another.
This is not hypothetical, we have people on our team (VisualEditor) who use 8, 4 and 3 (that I know of).
- Trevor
[1] http://www.mediawiki.org/wiki/CC#Line_continuation [2] http://www.mediawiki.org/wiki/CC#Tab_size
On Wed, Aug 8, 2012 at 11:26 AM, Adam Wight awight@wikimedia.org wrote:
On 08/08/2012 11:07 AM, Mark Holmquist wrote:
Also, "it should be 4 spaces" is a matter of opinion--everyone likes
different tab widths depending on their preferences and monitor size.
http://www.mediawiki.org/wiki/**CC#Tab_sizehttp://www.mediawiki.org/wiki/CC#Tab_size
"you should make no assumptions" appears to support Chad's statement. However, I'm pretty sure that in reality, many people assume a width of 4. I've definitely seen funky tab-plus-space indentations that support that theory.
I officially redact my bogus claim that it "should" be 4 spaces. However, we certainly shouldn't default to 8!
(moral authority provided by: Cleric: And the Lord spake, saying, "First shalt thou take out the Holy Pin. Then shalt thou count to three, no more, no less. Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. *Five is right out.* Once the number three, being the third number, be reached, then lobbest thou thy Holy Hand Grenade of Antioch towards thy foe, who, being naughty in my sight, shall snuff it.)
______________________________**_________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/wikitech-lhttps://lists.wikimedia.org/mailman/listinfo/wikitech-l
Lines have a 20 column range for breaking. If you are particularly worried about tab variation, split the difference -- if you personally aim for a cut-off of 90 columns, you'll still fall in the 80-100 column range for most tab variations (until you get into multiple tabs, but at that point two 8-space tabs uses up ~16-20% of your usable space, and gets progressively more consumptive from there).
Nabil
On Wed, Aug 8, 2012 at 11:43 AM, Trevor Parscal tparscal@wikimedia.orgwrote:
I've always wondered about something:
Given the 2 rules:
- "Lines should be broken at between 80 and 100 columns."[1]
- "You should make no assumptions about the number of spaces per
tab."[2]
I have a couple of questions:
- What should we do if someone who uses 1 space tabs writes a 99
character line (including the tab)? - If you are using more than 1 space per tab, you they are breaking the 100 column rule.
- What should we do if someone who uses 8 space tabs tells you that you
are breaking the 100 column rule? - If you are using less than 8 spaces per tab, than you aren't breaking the 100 column rule.
I get why there's no value in starting a holy war over spaces-per tab, but this is a good example of why it's also a problem to not make a decision one way or another.
This is not hypothetical, we have people on our team (VisualEditor) who use 8, 4 and 3 (that I know of).
- Trevor
[1] http://www.mediawiki.org/wiki/CC#Line_continuation [2] http://www.mediawiki.org/wiki/CC#Tab_size
wikitech-l@lists.wikimedia.org