swift-server / swift-prometheus

Prometheus client library for Swift
https://swiftpackageindex.com/swift-server/swift-prometheus
Apache License 2.0
142 stars 30 forks source link

Switch from swiftformat to swift-format #107

Closed armandgrillet closed 11 months ago

armandgrillet commented 11 months ago

This PR is made to close https://github.com/swift-server/swift-prometheus/issues/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 commented 11 months ago

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 commented 11 months ago

@swift-server-bot add to allowlist

armandgrillet commented 11 months ago

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... okay.
=> Checking format... 127
Build step 'Execute shell' marked build as failure

Does someone have access to more logs?

armandgrillet commented 11 months ago

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 commented 11 months ago

The way to reproduce CI is:

hope this helps?

FranzBusch commented 11 months ago

Thanks for the contribution @armandgrillet