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

Allow controlling whitespace rules after header contents #860

Open
ascopes opened this issue Nov 24, 2024 · 0 comments
Open

Allow controlling whitespace rules after header contents #860

ascopes opened this issue Nov 24, 2024 · 0 comments
Labels
is:feature New feature

Comments

@ascopes
Copy link

ascopes commented Nov 24, 2024

Describe the feature

Thanks for the awesome plugin, first off. It is really useful for what I am working with!

I run a few projects that use this plugin to enforce license headers in Java sources amongst other things. I also make use of Checkstyle in these projects to enforce the Google Java code style in my work.

I've encountered a bit of an annoyance where by the rule set for Checkstyle expects a space between any license header and the package declaration for the file. Unfortunately, I cannot seem to find a way for the license plugin to respect whitespace at the end of the license.txt file that I am using. This becomes a little annoying to manage as well since EditorConfig enforcement likes to strip away trailing whitespace in files.

The feature that I'd like to see is something that allows us to say "put an empty line after the license header". If I do this manually, it is fine and the plugin respects it, but this makes the license:format goal somewhat painful to use as I have to manually change the file formatting after running it.

Current output:

/*
 * Copyright (C) 2023 - 2024, Ashley Scopes.
 * ...
 */
package io.github.ascopes.protobufmavenplugin.sources.incremental;

Desired output:

/*
 * Copyright (C) 2023 - 2024, Ashley Scopes.
 * ...
 */

package io.github.ascopes.protobufmavenplugin.sources.incremental;

Any alternative you've considered ?

  • I could wrap this in my own script, but that feels a bit like a hacky workaround that I'd rather avoid if possible.
  • I could alter the Checkstyle rules, but ideally I don't think I should need to do this as I'd like the license output to match my required code style rather than the code style satisfying the output of the license plugin.
@ascopes ascopes added the is:feature New feature label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:feature New feature
Projects
None yet
Development

No branches or pull requests

1 participant