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
We have an automated tool in pkg/test_runner/tool/update_static_error_tests.dart that will automatically regenerate the test expectation comments in static error tests. That tool generally tries to indent the expectation comments at the same level as the previous line, like:
classC {
voidmethod() {
some + code;
// ^ Some error expectation on "+".
}
}
But if the error marker is too early in the line, it will put the comment at column zero. This was safe to do because the old formatter never indented a line comment if it was at the beginning of the line. That feature is handy here, but was basically an anti-feature everywhere else, so the new formatter doesn't do that.
That means that if you update the test expectations and then format it, expectation comments may get shifted over and point at the wrong column. We should update update_static_error_tests.dart so that it always indents the comment with the previous line and then writes an explicit column number (which the static error test already supports) if the column needs to be before where the indented // starts.
The text was updated successfully, but these errors were encountered:
munificent
added
the
area-test
Cross-cutting test issues (use area- labels for specific failures; not used for package:test).
label
Nov 6, 2024
We have an automated tool in
pkg/test_runner/tool/update_static_error_tests.dart
that will automatically regenerate the test expectation comments in static error tests. That tool generally tries to indent the expectation comments at the same level as the previous line, like:But if the error marker is too early in the line, it will put the comment at column zero. This was safe to do because the old formatter never indented a line comment if it was at the beginning of the line. That feature is handy here, but was basically an anti-feature everywhere else, so the new formatter doesn't do that.
That means that if you update the test expectations and then format it, expectation comments may get shifted over and point at the wrong column. We should update
update_static_error_tests.dart
so that it always indents the comment with the previous line and then writes an explicit column number (which the static error test already supports) if the column needs to be before where the indented//
starts.The text was updated successfully, but these errors were encountered: