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
Add no_package extra-validation flag and rename missing_package to empty_or_no_package
Summary:
Add a new `no_package` extra-validation flag (default: `none`) that fires when a
.thrift file has no `package` directive at all — not even an explicitly empty
`package;`. This is distinct from the existing check (renamed from
`missing_package` to `empty_or_no_package`) which fires when the package has no
URI content.
Reviewed By: hchokshi
Differential Revision: D95601653
fbshipit-source-id: b4cdca23537f05e0aab8a1316a0430805bbd6140
# expected-warning@-1: Thrift file should have a (non-empty) package. Packages will soon be required, at which point missing packages will trigger a Thrift compiler error. For more details, see https://fburl.com/thrift-uri-add-package
1644
+
# expected-warning@-1: Thrift file should have a (non-empty) package. This will soon become an error (see https://fburl.com/thrift-uri-add-package).
# expected-warning@-2: Thrift file should have a (non-empty) package. Packages will soon be required, at which point missing packages will trigger a Thrift compiler error. For more details, see https://fburl.com/thrift-uri-add-package
1705
+
# expected-warning@-2: Thrift file should have a (non-empty) package. This will soon become an error (see https://fburl.com/thrift-uri-add-package).
# expected-error@-2: Unnecessary use of @thrift.AllowLegacyMissingUris at the package level: there are no types who are missing URIs in the file.
1750
-
# expected-warning@-3: Thrift file should have a (non-empty) package. Packages will soon be required, at which point missing packages will trigger a Thrift compiler error. For more details, see https://fburl.com/thrift-uri-add-package
1750
+
# expected-warning@-3: Thrift file should have a (non-empty) package. This will soon become an error (see https://fburl.com/thrift-uri-add-package).
1751
1751
1752
1752
// Struct has a URI, making the package annotation redundant.
# expected-warning@-2: Thrift file should have a (non-empty) package. Packages will soon be required, at which point missing packages will trigger a Thrift compiler error. For more details, see https://fburl.com/thrift-uri-add-package
1769
+
# expected-warning@-2: Thrift file should have a (non-empty) package. This will soon become an error (see https://fburl.com/thrift-uri-add-package).
1770
1770
1771
1771
// Struct has a URI, making the package annotation redundant.
# expected-warning@-2: Thrift file should have a (non-empty) package. Packages will soon be required, at which point missing packages will trigger a Thrift compiler error. For more details, see https://fburl.com/thrift-uri-add-package
1788
+
# expected-warning@-2: Thrift file should have a (non-empty) package. This will soon become an error (see https://fburl.com/thrift-uri-add-package).
1789
1789
1790
1790
// Annotation is redundant: package already has the annotation
1791
1791
@thrift.AllowLegacyMissingUris
@@ -1807,7 +1807,7 @@ TEST(
1807
1807
1808
1808
@thrift.AllowLegacyMissingUris
1809
1809
package;
1810
-
# expected-warning@-2: Thrift file should have a (non-empty) package. Packages will soon be required, at which point missing packages will trigger a Thrift compiler error. For more details, see https://fburl.com/thrift-uri-add-package
1810
+
# expected-warning@-2: Thrift file should have a (non-empty) package. This will soon become an error (see https://fburl.com/thrift-uri-add-package).
1811
1811
1812
1812
// Annotation is redundant: package already has the annotation
# expected-warning@-1: Thrift file should have a (non-empty) package. Packages will soon be required, at which point missing packages will trigger a Thrift compiler error. For more details, see https://fburl.com/thrift-uri-add-package
3048
+
# expected-warning@-1: Thrift file is missing a `package` directive. This will soon become an error (see https://fburl.com/thrift-uri-add-package).
# expected-warning@-1: Thrift file should have a (non-empty) package. Packages will soon be required, at which point missing packages will trigger a Thrift compiler error. For more details, see https://fburl.com/thrift-uri-add-package
4194
+
# expected-warning@-1: Thrift file should have a (non-empty) package. This will soon become an error (see https://fburl.com/thrift-uri-add-package).
# expected-warning@-2: Thrift file should have a (non-empty) package. Packages will soon be required, at which point missing packages will trigger a Thrift compiler error. For more details, see https://fburl.com/thrift-uri-add-package
4227
+
# expected-warning@-2: Thrift file should have a (non-empty) package. This will soon become an error (see https://fburl.com/thrift-uri-add-package).
4155
4228
4156
4229
// Error: package-level AllowLegacyMissingUris does not suppress
# expected-warning@-1: Thrift file should have a (non-empty) package. Packages will soon be required, at which point missing packages will trigger a Thrift compiler error. For more details, see https://fburl.com/thrift-uri-add-package
275
+
# expected-warning@-1: Thrift file is missing a `package` directive. This will soon become an error (see https://fburl.com/thrift-uri-add-package).
0 commit comments