Skip to content

Commit

Permalink
Move code_format_checks gradle task definition to code-formatting f…
Browse files Browse the repository at this point in the history
…ile (#2900)

<!--
Note: This checklist is a reminder of our shared engineering
expectations.
The items in Bold are required
If your PR involves UI changes:
1. Upload screenshots or screencasts that illustrate the changes before
/ after
2. Add them under the UI changes section (feel free to add more columns
if needed)
    3. Make sure these changes are tested in API 23 and API 26
If your PR does not involve UI changes, you can remove the **UI
changes** section
-->

Task/Issue URL:
https://app.asana.com/0/488551667048375/1204079770253953/f

### Description
Moves the gradle task definition for `code_format_checks` up into
`code-formatting.gradle`, which all the modules apply
from. This should ensure when CI executes `./gradlew
code_format_checks`, all modules are checked for code formatting
violations.

### Steps to test this PR

- [x] It is expected the checks will fail until
#2888 is merged, so let's
merge that first 🛑
- [ ] Once PR above is merged, Run `./gradlew code_format_checks`;
verify it passes
- [ ] Add a deliberate code format violation to any module (e.g., add an
extra space character to a function's parameter)
- [ ] Run `./gradlew code_format_checks`; verify it fails
  • Loading branch information
CDRussell committed Mar 3, 2023
1 parent d182c18 commit 1745e71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,6 @@ tasks.register('jvm_checks') {
dependsOn 'spotlessCheck', 'lint', 'testPlayDebugUnitTest'
}

tasks.register('code_format_checks') {
dependsOn 'spotlessCheck', 'lintKotlin'
}

tasks.register('lint_check') {
dependsOn 'lint'
}
Expand Down
4 changes: 4 additions & 0 deletions code-formatting.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ spotless {
kotlinter {
disabledRules = ['no-wildcard-imports', 'filename', 'package-name', 'annotation-spacing']
}

tasks.register('code_format_checks') {
dependsOn 'spotlessCheck', 'lintKotlin'
}
4 changes: 0 additions & 4 deletions gradle/android-library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ tasks.register('jvm_tests') {
dependsOn 'testDebugUnitTest'
}

tasks.register('code_format_checks') {
dependsOn 'spotlessCheck', 'lintKotlin'
}

tasks.register('lint_check') {
dependsOn 'lint'
}

0 comments on commit 1745e71

Please sign in to comment.