Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require static importing from Preconditions #468

Open
1 of 2 tasks
wuchong opened this issue Feb 22, 2025 · 1 comment · May be fixed by #472 or #473
Open
1 of 2 tasks

Require static importing from Preconditions #468

wuchong opened this issue Feb 22, 2025 · 1 comment · May be fixed by #472 or #473
Labels

Comments

@wuchong
Copy link
Member

wuchong commented Feb 22, 2025

Search before asking

  • I searched in the issues and found nothing similar.

Description

The code style of using com.alibaba.fluss.utils.Preconditions is not consistent in Fluss. Some may use static imports (checkNotNull(...);), some may use class imports (Preconditions.checkNotNull(...);).

We have a Preconditions static importing rule in checksytle, but that is for Guava Preconditions, and Guava Preconditions was forbidden and suggested to use Fluss Precondition.

<module name="RegexpSinglelineJava">

We just need to update the checkstyle rule to fit Fluss Precondition, and update all the class imports in the codebase.

        <module name="RegexpSinglelineJava">
            <property name="format" value="^import com.alibaba.fluss.utils.Preconditions;$"/>
            <property name="message" value="Static import functions from Fluss Preconditions"/>
        </module>

Willingness to contribute

  • I'm willing to submit a PR!
@liuxiaocs7
Copy link
Contributor

Hi, @wuchong, i want to have a try, plz assign to me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants