Skip to content
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

use GitHub actions for linting #1616

Closed
wants to merge 4 commits into from

Conversation

v1v
Copy link
Member

@v1v v1v commented Aug 18, 2022

What does this pull request do?

use GitHub actions for linting

Comment on lines 16 to 27
- uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
with: ## let's skip to run for all the files
extra_args: --help
- id: files
uses: jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42
- name: Configure PATH
run: echo "${GITHUB_WORKSPACE}/.ci/scripts" >> $GITHUB_PATH
- name: Precommit changes
run: |
for changed_file in ${{ steps.files.outputs.all }}; do
pre-commit run --files "${changed_file}"
done
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not find a better way to run pre-commit for the subset of changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I'd be fine with running pre-commit on everything. It should be very fast. But this also seems fine 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this also work without the for loop?

pre-commit run --files ${{ steps.files.outputs.all }}

pre-commit run --files can take a list of files. Not sure if we could run into some limit if the change affects hundreds of files, though (e.g. when Python 4.0 moves from spaces to tabs ;) )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, I'll try it in a bit :)

@apmmachine
Copy link
Contributor

apmmachine commented Aug 18, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-10-05T16:09:00.344+0000

  • Duration: 31 min 41 sec

Test stats 🧪

Test Results
Failed 0
Passed 5029
Skipped 3378
Total 8407

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /test linters : Run the Python linters only.

  • /test full : Run the full matrix of tests.

  • /test benchmark : Run the APM Agent Python benchmarks tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

.github/workflows/pre-commit.yml Outdated Show resolved Hide resolved
@apmmachine
Copy link
Contributor

apmmachine commented Aug 18, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (67/67) 💚
Files 100.0% (227/227) 💚
Classes 100.0% (227/227) 💚
Lines 91.3% (18070/19792) 👍
Conditionals 74.607% (2800/3753) 👍

@v1v v1v closed this Oct 10, 2022
@v1v
Copy link
Member Author

v1v commented Oct 10, 2022

Closed this PR, since it was much nicely done in #1658 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants