Hello,

I’m working on ThriftAnnotationLint, an independent Java annotation processor 
for projects using Facebook Swift or Airlift Drift annotations.

Some annotation mistakes are accepted by javac but fail later when Swift or 
Drift builds runtime metadata or initializes a codec. In an enterprise release 
pipeline, this can be especially costly when a model JAR is released first and 
the consuming server is deployed later. The problem may only appear during 
integration tests, application startup, or even after deployment.

Apache Thrift’s compiler validates Thrift IDL files, but that is a different 
layer from validating Java classes annotated for Swift or Drift. 
ThriftAnnotationLint moves these checks into compilation and reports 
diagnostics on the source element that introduced the problem.

It currently checks:

- duplicate, missing, or conflicting Thrift field IDs and names;
- invalid requiredness, constructors, builders, getters, setters, and unions;
- incompatible Java types and codec container shapes;
- undeclared recursive model cycles;
- reachable generic models from source and classpath dependencies.

The project is Java 8 compatible, has no runtime dependencies, and is verified 
against Facebook Swift 0.19.2–0.23.1 and Airlift Drift 1.18.

I also ran it against the public Airlift Drift repository. The processor 
successfully analyzed the real Drift sources. In strict mode, it identified 
four compatibility cases in TApplicationException that need discussion because 
Drift’s runtime metadata model differs from the processor’s static model.

Project:
https://github.com/EzraIO/thrift-annotation-lint

Maven Central:
Https://central.sonatype.com/artifact/io.github.ezraio/thrift-annotation-lint/0.2.2

I would appreciate feedback from Thrift users:

1. Have you encountered similar annotation or codec initialization failures?
2. Would compile-time validation be useful in your build pipeline?
3. Which validation rules or integrations would be most valuable?
4. Are there existing tools, internal or public, that cover this use case?

This is an independent project and is not an official Apache Thrift component.

Best regards,
Wang Wu

Reply via email to