Skip to content

Conversation

armandgrillet
Copy link
Contributor

This PR is made to close #94.

The code has been tested using swift-format lint --configuration .swift-format --recursive Sources.

Tests/PrometheusTests should be formatted as well but contains too many things to change for now, this is why I have started with only Sources and added "lineLength": 1000 to limit the number of changes to do.

@ktoso
Copy link
Collaborator

ktoso commented Oct 16, 2023

I think it's okey to take the hit and do it all at once -- format the tests too; it'd be weird to only have a part of the codebase use a formatter

@ktoso
Copy link
Collaborator

ktoso commented Oct 16, 2023

@swift-server-bot add to allowlist

@armandgrillet
Copy link
Contributor Author

Not sure why CI is failing, locally:

➜ swift-prometheus (armandgrillet/swift-format) ✔ bash scripts/soundness.sh
=> Checking for unacceptable language... okay.
=> Checking format... okay.
=> Checking license headers
   * swift-or-c... okay.
   * bash... okay.
   * dtrace... okay.
=> Checking for imports of umbrella NIO module... okay.

On https://ci.swiftserver.group/job/swift-prometheus-soundness-prb/25/console :

+ ./scripts/soundness.sh
=> Checking for unacceptable language... �[0;32mokay.�[0m
=> Checking format... 127
Build step 'Execute shell' marked build as failure

Does someone have access to more logs?

As of Swift 5.8, swift-format depends on the version of SwiftSyntax
whose parser has been rewritten in Swift and no longer has dependencies
on libraries in the Swift toolchain.

Defaulting to Swift 5.8 fixes the usage of swift-format in nightly
builds.
@armandgrillet
Copy link
Contributor Author

All checks now pass apart from pull request validation (soundness). Running it locally works though:

➜ swift-prometheus (armandgrillet/swift-format) ✔ bash scripts/soundness.sh
=> Checking for unacceptable language... okay.
=> Checking format... okay.
=> Checking license headers
   * swift-or-c... okay.
   * bash... okay.
   * dtrace... okay.
=> Checking for imports of umbrella NIO module... okay.

Could someone with better access rights tell me what the CI step is running so that I can try to reproduce locally? Right now the output on Jenkins does not give me the details I need to pass this last check.

@ktoso
Copy link
Collaborator

ktoso commented Oct 17, 2023

The way to reproduce CI is:

  • docker-compose -f docker/docker-compose.yaml -p swift-prometheus-soundness-prb build --pull
  • docker-compose -f docker/docker-compose.yaml -p swift-prometheus-soundness-prb run --rm soundness

hope this helps?

@armandgrillet armandgrillet requested a review from ktoso October 17, 2023 19:27
@FranzBusch
Copy link
Contributor

Thanks for the contribution @armandgrillet

@FranzBusch FranzBusch merged commit d734701 into swift-server:main Oct 18, 2023
@armandgrillet armandgrillet deleted the armandgrillet/swift-format branch October 18, 2023 13:10
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

Successfully merging this pull request may close these issues.

Switch to swift-format

3 participants