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

Pin formatter #995

Merged
merged 1 commit into from
Oct 15, 2020
Merged

Pin formatter #995

merged 1 commit into from
Oct 15, 2020

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Oct 15, 2020

Motivation:

We added SwiftFormat as part our CI to in order to keep formatting
consistent. However, new rules are often introduced and new behaviours
are added and the formatting can change quite significantly as a result.
In order to get stable formatting we need to pin the version we use or
include the tool as part of the project. This is somewhat annoying: in
the first case it requires the user to get the right version, in the
second case we add a depdendency which isn't required to consume the
library, that's a little silly! We can make the first case a little
nicer by providing a script to build the right version from source.

Modifications:

  • Add scripts/format.sh which builds a predefined version of SwiftFormat
    and runs it
  • Pin the version in .travis-install.sh to the same as in format.sh

Result:

  • SwiftFormat is pinned to a version

Motivation:

We added SwiftFormat as part our CI to in order to keep formatting
consistent. However, new rules are often introduced and new behaviours
are added and the formatting can change quite significantly as a result.
In order to get stable formatting we need to pin the version we use or
include the tool as part of the project. This is somewhat annoying: in
the first case it requires the user to get the right version, in the
second case we add a depdendency which isn't required to consume the
library, that's a little silly! We can make the first case a little
nicer by providing a script to build the right version from source.

Modifications:

- Add scripts/format.sh which builds a predefined version of SwiftFormat
  and runs it
- Pin the version in .travis-install.sh to the same as in format.sh

Result:

- SwiftFormat is pinned to a version
@glbrntt glbrntt added the semver/none No version bump required. label Oct 15, 2020
@glbrntt glbrntt requested a review from Lukasa October 15, 2020 14:43
@glbrntt glbrntt merged commit cdb46f4 into grpc:main Oct 15, 2020
@glbrntt glbrntt deleted the gb-pin-formatter branch October 15, 2020 15:04
glbrntt added a commit to glbrntt/grpc-swift that referenced this pull request Oct 19, 2020
Motivation:

We added SwiftFormat as part our CI to in order to keep formatting
consistent. However, new rules are often introduced and new behaviours
are added and the formatting can change quite significantly as a result.
In order to get stable formatting we need to pin the version we use or
include the tool as part of the project. This is somewhat annoying: in
the first case it requires the user to get the right version, in the
second case we add a depdendency which isn't required to consume the
library, that's a little silly! We can make the first case a little
nicer by providing a script to build the right version from source.

Modifications:

- Add scripts/format.sh which builds a predefined version of SwiftFormat
  and runs it
- Pin the version in .travis-install.sh to the same as in format.sh

Result:

- SwiftFormat is pinned to a version

(cherry picked from commit cdb46f4)
glbrntt added a commit that referenced this pull request Oct 19, 2020
Motivation:

We added SwiftFormat as part our CI to in order to keep formatting
consistent. However, new rules are often introduced and new behaviours
are added and the formatting can change quite significantly as a result.
In order to get stable formatting we need to pin the version we use or
include the tool as part of the project. This is somewhat annoying: in
the first case it requires the user to get the right version, in the
second case we add a depdendency which isn't required to consume the
library, that's a little silly! We can make the first case a little
nicer by providing a script to build the right version from source.

Modifications:

- Add scripts/format.sh which builds a predefined version of SwiftFormat
  and runs it
- Pin the version in .travis-install.sh to the same as in format.sh

Result:

- SwiftFormat is pinned to a version

(cherry picked from commit cdb46f4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants