Skip to content

introduce clang-format #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2019
Merged

introduce clang-format #333

merged 1 commit into from
Jul 31, 2019

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Jul 31, 2019

im having trouble locally running it for now

cc @aomarks

@43081j
Copy link
Contributor Author

43081j commented Jul 31, 2019

diff --git a/packages/checkbox/src/mwc-checkbox-base.ts b/packages/checkbox/src/mwc-checkbox-base.ts
index 1ccd645..1d7573b 100644
--- a/packages/checkbox/src/mwc-checkbox-base.ts
+++ b/packages/checkbox/src/mwc-checkbox-base.ts
@@ -14,32 +14,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */
-import {
-  html,
-  FormElement,
-  property,
-  query,
-  observer,
-  HTMLElementWithRipple,
-  addHasRemoveClass,
-  RippleSurface,
-} from '@material/mwc-base/form-element.js';
-import {ripple} from '@material/mwc-ripple/ripple-directive.js';
-import MDCCheckboxFoundation from '@material/checkbox/foundation.js';
 import {MDCCheckboxAdapter} from '@material/checkbox/adapter.js';
+import MDCCheckboxFoundation from '@material/checkbox/foundation.js';
+import {addHasRemoveClass, FormElement, html, HTMLElementWithRipple, observer, property, query, RippleSurface,} from '@material/mwc-base/form-element.js';
+import {ripple} from '@material/mwc-ripple/ripple-directive.js';

this is what im seeing

this awful trailing comma and lengthy one-line import near the bottom

@aomarks
Copy link
Contributor

aomarks commented Jul 31, 2019

#278 was submitted with the other .clang-format, so I think we should expect this one to reformat everything back to how it was earlier.

@43081j
Copy link
Contributor Author

43081j commented Jul 31, 2019

i've never seen that before.. leaving a trailing comma in a one-liner.

and its 150+ characters long, but the google column limit is 100 usually 🤔

something is off and you saw different results IIRC

@aomarks
Copy link
Contributor

aomarks commented Jul 31, 2019

Will merge this and see if I can fix the formatting in another PR.

@aomarks aomarks merged commit 767549a into material-components:master Jul 31, 2019
@43081j 43081j deleted the clang branch July 31, 2019 19:28
@aomarks
Copy link
Contributor

aomarks commented Jul 31, 2019

Looks like the issue with trailing commas was just that clang-format doesn't remove them if they're there, and they were there because of the earlier config that broke it up into multiple lines.

I think the line-limit doesn't need to apply to imports, so that's fine.

All fixed in #334 I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants