Skip to content

Verify Code Format as well as License Header presence during CI build #168

@vorburger

Description

@vorburger

I'm raising this issue prompted by https://github.com/google/adk-java/pull/102/files#r2132521541:

Is your feature request related to a problem? Please describe.

IMHO it would make the life of committers (maintainers) easier if this project would verify Code Format as well as missing License Header presence during CI build (and thus cause red build failures).

IMHO it would also make the life of contributors (PR raising community members) easier if this project had a very easy way to auto-format code according to the standards that this projects expects its code to be formatted with.

Describe the solution you'd like

The following is for discussion, but if it was up to me, I would go about this simply by adding a suitable pre-commit hook configuration, for both the Google Java Code Formatters, and the license headers checker/adder. (I have used and done this in a project of mine, and ready to copy/paste this here.)

Describe alternatives you've considered
Waste time of both committers and contributors by leaving "nit pick" comments about such things on PRs.

Using pre-commit would avoid requiring Python to be installed to run the pre-commit, but IMHO nowadays that shouldn't really be an issue. (And one could still locally build the project without it; just without the pre-commit.)

An alternative to avoid ^^^ would be to integrate the Google Java Code Formatters using (one of) its Maven Plugins. But I don't know (haven't looked into) a Maven license header checker, and as far as I know that's harder to easily cleanly integrate nicely as an automagic pre-commit.

Additional context

I'm happy to help by proposing a PR for this, if the project's committers concur that this would be useful?

@glaforge @Poggecci @cornellgit do you have any thought about / input on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions