Description
Several tools depend on the ability to add some metadata (@annotation
) at a file level.
With the test
package you can write
@Skip()
library my_test;
import 'package:test/test.dart';
Or
@Skip()
import 'package:test/test.dart';
The second form, is kind of a hack. The @Skip()
attribute is in fact attached to the first import
directive.
It causes problems with auto-formatters that re-order or remove imports. (See dart-lang/test#517)
The first form is safer but it requires to write a name for the library.
The linter recommends the name to be of the form package_name.test.path.to.file
(http://dart-lang.github.io/linter/lints/package_prefixed_library_names.html).
This rule is necessary to avoid a warning because 2 libraries have the same name.
But this is tedious to write and to maintain.
I would like to write either:
@Skip()
library;
import 'package:test/test.dart';
Or that the analyzer doesn't report warnings if 2 libraries are named _
. So I can write
@Skip()
library _;
import 'package:test/test.dart';