-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add ktlint 1.3.1; initial format, pre-commit hook, and GitHub Action #2
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
955918e
Add ktlint 1.3.1 GitHub action
darronschall addbd6f
Add `.editorconfig` with a few custom ktlint rules
darronschall 2bb8d42
`ktlint --format`
darronschall 2990005
Add ktlint ignore for long string in test.
darronschall 7f799b1
Add `.git-blame-ignore-revs` and ignore initial ktlint format
darronschall 1a875b9
Add `ktlint` as a pre-commit git hook
darronschall dc660ac
Add ktlint README badge
darronschall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# Top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
# YAML files | ||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# KtLint | ||
[*.{kt,kts}] | ||
ktlint_code_style = ktlint_official | ||
|
||
# Disable multiline-expression wrapping. This allows complex expressions to start on the same | ||
# line as the `=`, e.g. `= Modifier`, and `= listOf(` | ||
# See: https://pinterest.github.io/ktlint/1.3.1/rules/standard/#multiline-expression-wrapping | ||
ktlint_standard_multiline-expression-wrapping = disabled | ||
# Also need to disable the related rule so string templates behave similarly, e.g. `= """` | ||
# See: https://pinterest.github.io/ktlint/1.3.1/rules/standard/#string-template-indent | ||
ktlint_standard_string-template-indent = disabled | ||
|
||
# Only wrap functions when there is not enough space on the line | ||
# See: https://pinterest.github.io/ktlint/1.3.1/rules/standard/#function-signature | ||
ktlint_function_signature_body_expression_wrapping = default | ||
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 2 | ||
|
||
# Allow blank lines in lists, which can be useful to help visually break things up | ||
# and group related function params together | ||
# See: https://pinterest.github.io/ktlint/1.3.1/rules/standard/#no-blank-lines-in-list | ||
ktlint_standard_no-blank-line-in-list = disabled | ||
|
||
[**/build/generated/**] | ||
# Ignore generated code | ||
ktlint_standard = disabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Initial ktlint 1.3.1 installation and formatting | ||
2bb8d42a74ea6d3f7f7dd3e45cf6b58bd04cf63e | ||
29900055f992d0c84ecb4c0e880a25e994308fa0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
echo "Running ktlint..." | ||
|
||
ktlint | ||
status=$? | ||
|
||
# return 1 exit code if running checks fails | ||
[ $status -ne 0 ] && exit 1 | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Lint - Kotlin | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- "**.md" | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ktlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: install ktlint 1.3.1 | ||
# https://pinterest.github.io/ktlint/1.3.1/install/cli/#download-using-curl | ||
run: | | ||
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.3.1/ktlint | ||
chmod a+x ktlint | ||
mv ktlint /usr/local/bin/ | ||
|
||
- name: ktlint version | ||
run: ktlint --version | ||
|
||
- name: ktlint | ||
run: ktlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
[](https://pinterest.github.io/ktlint/) | ||
|
||
# OAuth PKCE Flow for Kotlin Multiplatform (Android/iOS) | ||
|
||
A Kotlin Multiplatform library for Android and iOS that provides an [OAuth PKCE flow](https://oauth.net/2/pkce/) implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Add Github Actions badge?