You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make test-tidy check that = have space after them #7460
A-machC-assignedThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.L-pythonPython is required
The answer is "kinda". The attributes get in the way of some of the tidy checks, but it would be beneficial to perform some checks (like this one) on them.
Ok, my local code now checks to make sure attributes like the one above (or any attribute with an = character) get checked for a space before and after the =. Other attributes like #[derive(Copy, Clone, PartialEq)] will be ignored.
There are quite a few files that violate the rule. Should I change these now?
# get rid of commentsline=re.sub('//.*?$|/\*.*?$|^\*.*?$', '', line)
# get rid of attributes that do not contain =line=re.sub('^#[A-Za-z0-9\(\)_\[\]_]*?$', '', line)
A-machC-assignedThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.L-pythonPython is required
Activity
SimonSapin commentedon Aug 30, 2015
Should we try and go full rustfmt instead?
jdm commentedon Aug 30, 2015
Ah, http://mxr.mozilla.org/servo/source/python/tidy.py#217 is not strict enough.
jdm commentedon Aug 30, 2015
@SimonSapin Nope; there are outstanding blockers last I checked.
jerneyio commentedon Aug 30, 2015
Mind if take this one?
jdm commentedon Aug 30, 2015
Go for it!
jerneyio commentedon Aug 30, 2015
While it's true that the regex isn't accounting for a cases like
#[cfg(target_os ="linux")], it looks like attributes in .rs files are being ignored anyway. See http://mxr.mozilla.org/servo/source/python/tidy.py#195. Is the desired behavior?jdm commentedon Aug 30, 2015
The answer is "kinda". The attributes get in the way of some of the tidy checks, but it would be beneficial to perform some checks (like this one) on them.
jerneyio commentedon Aug 31, 2015
Ok, my local code now checks to make sure attributes like the one above (or any attribute with an = character) get checked for a space before and after the =. Other attributes like
#[derive(Copy, Clone, PartialEq)]will be ignored.There are quite a few files that violate the rule. Should I change these now?
jerneyio commentedon Aug 31, 2015
Like @mylainos warned in #7390, the code I wrote will conflict with his change for line http://mxr.mozilla.org/servo/source/python/tidy.py#195.
jdm commentedon Aug 31, 2015
Yeah, I didn't think about things like
#[doc="foo"]. I think I'm fine making it#[doc = "foo"]in service of the greater good.Auto merge of #7468 - JoshTheGoldfish:Issue7460, r=jdm
jerneyio commentedon Sep 3, 2015
Can this be closed?
jdm commentedon Sep 3, 2015
Yep!