-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only allow the comment at the top of the formatted code.
- Loading branch information
1 parent
6d60708
commit 503da82
Showing
5 changed files
with
59 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,116 @@ | ||
40 columns | | ||
### Tests for the comment to set formatting width. | ||
>>> Comment sets page width. | ||
// dart format width=30 | ||
main() { | ||
// dart format width=30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
<<< | ||
// dart format width=30 | ||
main() { | ||
// dart format width=30 | ||
fitsUnsplitAt40 + | ||
butNotAt30; | ||
} | ||
>>> Comment anywhere affects all code. | ||
>>> Comment only takes effect if it appears before code. | ||
main() { | ||
// dart format width=30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
// dart format width=30 | ||
<<< | ||
main() { | ||
fitsUnsplitAt40 + | ||
butNotAt30; | ||
// dart format width=30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
|
||
>>> If there are multiple comments, first one wins. | ||
// dart format width=30 | ||
>>> If multiple comments, first one wins. | ||
// dart format width=60 | ||
main() { | ||
// dart format width=30 | ||
// dart format width=60 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
<<< | ||
// dart format width=30 | ||
// dart format width=60 | ||
main() { | ||
// dart format width=30 | ||
// dart format width=60 | ||
fitsUnsplitAt40 + | ||
butNotAt30; | ||
} | ||
>>> Does nothing if width is not an integer. | ||
// dart format width=wat | ||
main() { | ||
// dart format width=wat | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
<<< | ||
// dart format width=wat | ||
main() { | ||
// dart format width=wat | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
>>> Can't have trailing text. | ||
// dart format width=30 some more text | ||
main() { | ||
// dart format width=30 some more text | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
<<< | ||
// dart format width=30 some more text | ||
main() { | ||
// dart format width=30 some more text | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
>>> Whitespace must match exactly. | ||
//dart format width=30 | ||
main() { | ||
//dart format width=30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
<<< | ||
//dart format width=30 | ||
main() { | ||
//dart format width=30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
>>> Whitespace must match exactly. | ||
// dart format width=30 | ||
main() { | ||
// dart format width=30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
<<< | ||
// dart format width=30 | ||
main() { | ||
// dart format width=30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
>>> Whitespace must match exactly. | ||
// dart format width = 30 | ||
main() { | ||
// dart format width = 30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
<<< | ||
// dart format width = 30 | ||
main() { | ||
// dart format width = 30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
>>> Can't be doc comment. | ||
>>> Can't be a doc comment. | ||
/// dart format width=30 | ||
main() { | ||
/// dart format width=30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
<<< | ||
/// dart format width=30 | ||
main() { | ||
/// dart format width=30 | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
>>> Can't be nested inside other comment. | ||
>>> Can't be nested inside another comment. | ||
/* // dart format width=30 */ | ||
main() { | ||
/* // dart format width=30 */ | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
<<< | ||
/* // dart format width=30 */ | ||
main() { | ||
/* // dart format width=30 */ | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
>>> Can't be inside string literal. | ||
>>> Can't be inside a string literal. | ||
var c = '// dart format width=30'; | ||
main() { | ||
var c = '// dart format width=30'; | ||
fitsUnsplitAt40 + butNotAt30; | ||
} | ||
<<< | ||
var c = '// dart format width=30'; | ||
main() { | ||
var c = '// dart format width=30'; | ||
fitsUnsplitAt40 + butNotAt30; | ||
} |