-
Notifications
You must be signed in to change notification settings - Fork 134
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
RUMM-1204 Linter not run for carthage builds #450
RUMM-1204 Linter not run for carthage builds #450
Conversation
72f0621
to
afa856c
Compare
I succeeded to fail in CI ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using $CARTHAGE == YES
to exclude linter for Carthage builds looks good 👌, but the changes made to bitrise.yml
introduce very odd setup:
- the
run_unit_tests
step may fail due to linter issue in SDK code or tests, - the
run_unit_tests
step may fail due to linter issue in other tools code or tests (e.g. bad formatting inapi-surface
tests), - as we retry
run_unit_tests
step upon failure, it will be run twice on linter issue.
If we want to run linter only once on CI, this should be run as part of run_linter
step, not run_unit_tests
. Excluding linter from run_unit_tests
sounds OK, but in this PR we're removing the entire run_linter
.
bitrise.yml
Outdated
- swiftlint@0.8.0: | ||
title: Lint Sources/* | ||
inputs: | ||
- strict: 'yes' | ||
- lint_config_file: "$BITRISE_SOURCE_DIR/tools/lint/sources.swiftlint.yml" | ||
- linting_path: "$BITRISE_SOURCE_DIR" | ||
- reporter: emoji | ||
- swiftlint@0.8.0: | ||
title: Lint Tests/* | ||
is_always_run: true | ||
inputs: | ||
- strict: 'yes' | ||
- linting_path: "$BITRISE_SOURCE_DIR" | ||
- lint_config_file: "$BITRISE_SOURCE_DIR/tools/lint/tests.swiftlint.yml" | ||
- reporter: emoji |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those steps were linting more than SDK code, see linter configuration:
# tools/lint/sources.swiftlint.yml:
- instrumented-tests/http-server-mock/Sources
- tools/api-surface/Sources
- tools/api-surface/Fixtures/Sources
- tools/rum-models-generator/Sources
- tools/rum-models-generator/Tests/rum-models-generator-coreTests/Fixtures/Output # lint generation fixture
- dependency-manager-tests/carthage/CTProject
- dependency-manager-tests/cocoapods/CPProject
- dependency-manager-tests/spm/SPMProject
# tools/lint/tests.swiftlint.yml:
- instrumented-tests/http-server-mock/Tests
- tools/api-surface/Tests
- tools/rum-models-generator/Tests
- dependency-manager-tests/carthage/CTProjectTests
- dependency-manager-tests/carthage/CTProjectUITests
- dependency-manager-tests/cocoapods/CTProjectTests
- dependency-manager-tests/cocoapods/CTProjectUITests
- dependency-manager-tests/spm/SPMProjectTests
- dependency-manager-tests/spm/SPMProjectUITests
Now, these sources are lint as part of "Run unit tests for Datadog - iOS Simulator" which is wrong (we shouldn't fail SDK tests due to linter issue in rum-models-generator
tool).
a52d30d
to
d9b5d2c
Compare
If CARTHAGE flag is set for xcodebuild, build phase is skipped
d9b5d2c
to
807ca7c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 as an optimisation, we could also skip running linter from Xcode build on CI. That might give us ~30s
boost to the job time.
176aeb0
into
ncreated/RUMM-1222-enforce-up-to-date-version-of-swiftlint
What and why?
Datadog.xcodeproj
hasRun linter
build phase.Our SPM&cocoapods users don't see
xcodeproj
but our carthage users build the framework from it.They don't need to lint our framework's source.
How?
Skip linting for
carthage
carthage
passesCARTHAGE=YES
flag toxcodebuild
, ourRun linter
build phase checks this flag and it skips linting forcarthage
builds.Review checklist