-
-
Notifications
You must be signed in to change notification settings - Fork 276
Add format action #1405
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
Merged
Merged
Add format action #1405
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
a2f0917
add format action
denrase b815694
fix matrix
denrase b520e13
run correct pub get command
denrase c038c05
setup flutter
denrase e78d9df
correct relatice path to commit script
denrase 20e9602
move script to correct folder
denrase 54ffd1e
test flutter format
denrase 30cc41b
Format & fix code
getsentry-bot b55912f
test fix in flutter package, test format & fix in dart package
denrase 509b678
Format & fix code
getsentry-bot 65b9ccf
Format & fix code
getsentry-bot a7ec068
Merge branch 'main' into feat/gh-format-action
denrase 7d8f145
remove pub get and introduce format and fix issue in flutter package
denrase 691cecf
Format & fix code
getsentry-bot b2b1f47
Merge branch 'main' into feat/gh-format-action
denrase a8e5ff8
Merge branch 'feat/gh-format-action' of github.com:getsentry/sentry-d…
denrase 2e07839
restore imports
denrase 23d98b1
run dart/flutter pub get before again
denrase b9b7326
introduce issues in file package & run fomat/fix
denrase 82305c1
Format & fix code
getsentry-bot 884cd0c
add dio pakcage and introduce issues there
denrase 25f8282
Format & fix code
getsentry-bot fbd1702
introduce issue and run in sqflite
denrase 21b58ac
run flutter pub get in sqflite
denrase cbcaaea
run flutter action
denrase 03335b0
Format & fix code
getsentry-bot 6b516f4
run in logging package and introduce issues
denrase c265f96
Format & fix code
getsentry-bot 86c0225
Merge branch 'main' into feat/gh-format-action
denrase 18a9068
move format fix and commit to analyze step
denrase 788426f
introduce error
denrase 6f8e7ba
Format & fix code
getsentry-bot 3eaea3b
Merge branch 'main' into feat/gh-format-action
marandaneto 4a24859
Merge branch 'main' into feat/gh-format-action
denrase 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 hidden or 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 |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ jobs: | |
| access_token: ${{ github.token }} | ||
|
|
||
| analyze: | ||
| name: Format, fix & analyze Code | ||
| if: ${{ !startsWith(github.ref, 'refs/heads/release/') }} | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
|
|
@@ -36,8 +37,17 @@ jobs: | |
| if: ${{ inputs.sdk == 'dart' }} | ||
| - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa # [email protected] | ||
| if: ${{ inputs.sdk == 'flutter' }} | ||
|
|
||
| - run: ${{ inputs.sdk }} pub get | ||
| - run: ${{ inputs.sdk }} format --set-exit-if-changed ./ | ||
|
|
||
| - run: dart format . | ||
|
|
||
| - run: dart fix --apply | ||
|
|
||
| # actions/checkout fetches only a single commit in a detached HEAD state. Therefore | ||
| # we need to pass the current branch, otherwise we can't commit the changes. | ||
| # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. | ||
| - run: ../scripts/commit-formatted-code.sh $GITHUB_HEAD_REF | ||
|
|
||
| - name: dart analyze | ||
| uses: invertase/github-action-dart-analyzer@cdd8652b05bf7ed08ffce30f425436780f869f13 # pin@v1 | ||
|
|
||
This file contains hidden or 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 hidden or 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,16 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| GITHUB_BRANCH="${1}" | ||
|
|
||
| if [[ $(git status) == *"nothing to commit"* ]]; then | ||
| echo "Nothing to commit. All code formatted correctly." | ||
| else | ||
| echo "Formatted some code. Going to push the changes." | ||
| git config --global user.name 'Sentry Github Bot' | ||
| git config --global user.email '[email protected]' | ||
| git fetch | ||
| git checkout ${GITHUB_BRANCH} | ||
| git commit -am "Format & fix code" | ||
| git push --set-upstream origin ${GITHUB_BRANCH} | ||
| fi |
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.
Uh oh!
There was an error while loading. Please reload this page.