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

Upgrade to Spotless 2.0 #404

Closed
1 task done
sbrannen opened this issue Jul 14, 2016 · 6 comments
Closed
1 task done

Upgrade to Spotless 2.0 #404

sbrannen opened this issue Jul 14, 2016 · 6 comments
Assignees
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Jul 14, 2016

Status Quo

Spotless 2.0 should fix issues regarding EOL characters on Windows (see diffplug/spotless#23).

Related Issues

Deliverables

  • Upgrade to Spotless 2.0 once it is released.
@sbrannen sbrannen modified the milestones: 5.0 M2, 5.0 M3 Jul 14, 2016
@nedtwigg
Copy link
Contributor

nedtwigg commented Aug 16, 2016

Just FYI, Spotless 2.0 is now available.

I think right now you've got something like this:

spotless {
    ...
    lineEndings 'UNIX'
}

You shouldn't need to specify lineEndings any longer - it will automatically use the same line endings policy as git.

@sbrannen
Copy link
Member Author

Hi @nedtwigg,

Thanks for the heads up and congratulations on releasing Spotless 2.0!

I just tried it locally, and it works fine.

As for removing the explicit lineEndings declaration, we do not currently have a custom .gitattributes file in place. So, please correct me if I'm wrong, but... my understanding is that the default settings (and search algorithm for custom line ending settings) in Spotless 2.0 won't help us unless we create such a custom .gitattributes file.

Can you please confirm the above assumption?

Cheers,

Sam

@sbrannen
Copy link
Member Author

in progress

sbrannen added a commit that referenced this issue Aug 16, 2016
sbrannen added a commit that referenced this issue Aug 16, 2016
Due to the recent upgrade to Spotless 2.0, it should (theoretically) no
longer be necessary to provide explicit `lineEndings` configuration.

Issue: #404
@sbrannen
Copy link
Member Author

@nedtwigg,

The latest build on Windows just passed.... with the Spotless lineEndings configuration removed:

https://ci.appveyor.com/project/marcphilipp/junit5/build/101

So, maybe we can just assume it's working properly, ... but a confirmation would still be nice. 😉

@nedtwigg
Copy link
Contributor

nedtwigg commented Aug 16, 2016

You do have a .gitattributes file:

https://github.com/junit-team/junit5/blob/master/.gitattributes, added in dc5e875

and so everything is working properly.

If you didn't have a .gitattributes file, then git would check them out as \r\n, and if you have tests which rely on line ending (which I believe you do), then you'd have problems. And you could tell spotless lineEndings 'UNIX', but the problem then would be that the build would fail until you called spotlessApply. And once you called spotlessApply, everything in the working tree would be marked dirty, so you had to tell spotless AND .gitattributes.

Before spotless 2.0, it was really important to synchronize git and spotless on the line ending. Now they're always synchronized unless you go out of your way to manually specify a line ending to spotless.

@sbrannen
Copy link
Member Author

@nedtwigg, well... you're totally correct!

I must be getting senile, since I'm the one who created that .gitattributes file. 😉

Thanks for reminding me,

Sam

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

No branches or pull requests

2 participants