Skip to content

Commit

Permalink
[GH] Use relative paths for ktlint arguments
Browse files Browse the repository at this point in the history
The latest ktlint update removed the support for absolute paths as
arguments.
pinterest/ktlint#1131

Github workflow used to prepend the checkout source to make paths
absolute and now it does not work anymore. This PR
replaces it with `..` since we run ktlint inside `activity` project.

There is probably a better shell magic to get this but I think .. is good
enough for now. (there does not seem to be a consistent solution between
mac and linux for relative paths).

Bug: n/a
Test: locally verified that relative paths with .. works by manually
breaking a file's style in room and invoked ktlint in activity as the
workflow does.

This is an imported pull request from #247.

Resolves #247
Github-Pr-Head-Sha: da89915
GitOrigin-RevId: 80adfcd
Change-Id: Ie6ec09c66a57f89970aff9da581135769b43ca9f
  • Loading branch information
yigit authored and Copybara-Service committed Sep 27, 2021
1 parent 85df931 commit d5c8b4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/presubmit.yml
Expand Up @@ -87,7 +87,7 @@ jobs:
id: ktlint-file-args
run: |
set -x
KTLINT_FILES=`echo "${{ steps.changed-files.outputs.files }}" | sed 's|[^ ]* *|--file=${{ github.workspace }}/&|g' | grep -v "*.txt"`
KTLINT_FILES=`echo "${{ steps.changed-files.outputs.files }}" | sed 's|[^ ]* *|--file=../&|g' | grep -v "*.txt"`
echo "::set-output name=ktlint-file-args::$KTLINT_FILES"
- name: "Parse changed-files as affected files args"
Expand Down

0 comments on commit d5c8b4a

Please sign in to comment.