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

Linting #581

Open
2 tasks
wetneb opened this issue May 11, 2021 · 5 comments
Open
2 tasks

Linting #581

wetneb opened this issue May 11, 2021 · 5 comments

Comments

@wetneb
Copy link
Member

wetneb commented May 11, 2021

My IDE is probably not configured to the correct tab vs space setting (or tab width…), so I get ugly diffs.

It would be nice to:

  • document the code style used in the project and how to configure one's IDE to respect it
  • add a linter to the CI to prevent people from accidentally pushing incorrect whitespace…
@robertvazan
Copy link
Collaborator

This is a subset of #535.

@robertvazan
Copy link
Collaborator

Though, I would note, It's probably impossible to configure all IDEs consistently. Maintaining indentation by hand is a nightmare. If we aren't going to standardize on an IDE, then it would be best to tolerate small amount of diff noise and have someone run a formatter periodically to keep the code style consistent.

@wetneb
Copy link
Member Author

wetneb commented Jun 11, 2021

I had a look at a few established Java projects and none of them seemed to check linting in their CI. Is it perhaps not a widespread practice in the Java world? Has anyone got examples of Java projects where this is used?

@thadguidry
Copy link

thadguidry commented Jun 11, 2021

@wetneb It is widespread, but not sure how you are looking or searching for style checking tools as part of older Travis or newer GitHub workflows? Many projects just use Checkstyle (directly, or through Maven or Gradle plugins)

I think in a pinch, you could just wire up Codacy (which does Checkstyle) and then manage with some config or options to only do style checking and nothing else? Dunno, you'd have to check with them or the Checkstyle community.

@wetneb
Copy link
Member Author

wetneb commented May 5, 2023

Update: in OpenRefine, we use mvn formatter:validate (to check linting in the CI) and mvn formatter:format to format the code. It works well.

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

No branches or pull requests

3 participants