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

feat: unify linting #27590

Merged
merged 68 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
83873ee
feat: unify staged-recipes linting
beckermr Sep 15, 2024
867543a
Revert "feat: unify staged-recipes linting"
beckermr Sep 15, 2024
8f8f28f
feat: unify staged-recipes linting
beckermr Sep 15, 2024
b46ac73
fix: wrong linting path
beckermr Sep 15, 2024
08bf948
fix: need pr number
beckermr Sep 15, 2024
34a9c4f
feat: comment on files and concurency
beckermr Sep 15, 2024
6314cc8
feat: annotate each file once
beckermr Sep 15, 2024
3338c42
feat: output summary
beckermr Sep 15, 2024
97da0a4
feat: output summary
beckermr Sep 15, 2024
1c3a710
fix: always output summary
beckermr Sep 15, 2024
7a349e6
fix: better formatting
beckermr Sep 15, 2024
f14c20f
fix: newlines and formatting
beckermr Sep 15, 2024
0734b44
feat: add extra warning
beckermr Sep 15, 2024
3f541e3
feat: add extra warning
beckermr Sep 15, 2024
85cddfb
feat: add extra warning
beckermr Sep 15, 2024
43d8abb
fix: bad formatting
beckermr Sep 15, 2024
859808c
fix: bad formatting
beckermr Sep 15, 2024
a9ae0f2
feat: comment directly
beckermr Sep 15, 2024
635b995
feat: comment directly
beckermr Sep 15, 2024
8861577
feat: comment directly
beckermr Sep 15, 2024
8802749
feat: make log parsing possible and fic summary and add warning
beckermr Sep 15, 2024
5f5f991
feat: try to add PR comments
beckermr Sep 15, 2024
ca63c0b
Merge pull request #1 from beckermr/unify-linting
beckermr Sep 15, 2024
f4f973d
test
beckermr Sep 15, 2024
8d94579
fix: specify owner
beckermr Sep 15, 2024
144483d
Merge pull request #2 from beckermr/unify-linting
beckermr Sep 15, 2024
1ef2f83
test
beckermr Sep 15, 2024
f11cd12
try this
beckermr Sep 15, 2024
41617f6
Merge pull request #3 from beckermr/unify-linting
beckermr Sep 15, 2024
1945118
test
beckermr Sep 15, 2024
8b7d52d
fix: need the code
beckermr Sep 15, 2024
8eb36c7
Merge pull request #4 from beckermr/unify-linting
beckermr Sep 15, 2024
50bc17b
test
beckermr Sep 15, 2024
9974f11
bug
beckermr Sep 15, 2024
96f40cd
Merge pull request #5 from beckermr/unify-linting
beckermr Sep 15, 2024
fee2d3b
test
beckermr Sep 15, 2024
3c25541
fix: use proper event syntax
beckermr Sep 15, 2024
ef7ae4f
Merge pull request #6 from beckermr/unify-linting
beckermr Sep 15, 2024
670d9c6
test
beckermr Sep 15, 2024
14b1e69
fix: comment on correct pr
beckermr Sep 15, 2024
9905a82
Merge pull request #7 from beckermr/unify-linting
beckermr Sep 15, 2024
1355551
test
beckermr Sep 15, 2024
33cfc82
Update lint_staged_recipes_make_comment.py
beckermr Sep 15, 2024
44d6aba
fix: comment on correct pr
beckermr Sep 15, 2024
b9a300e
Merge branch 'main' into unify-linting
beckermr Sep 15, 2024
4d97c69
test
beckermr Sep 15, 2024
f7a5646
fix: comment on correct pr
beckermr Sep 15, 2024
43cbe00
test
beckermr Sep 15, 2024
d8171a0
fix: print a message that there is no comment
beckermr Sep 15, 2024
b6cb666
fix: typo
beckermr Sep 15, 2024
6dc6cd5
Merge branch 'main' into unify-linting
beckermr Sep 15, 2024
9c721a9
try some edits
beckermr Sep 15, 2024
ac6e31b
Merge branch 'unify-linting' of https://github.com/beckermr/staged-re…
beckermr Sep 15, 2024
8ad685b
fix: lint has slightly wrong test
beckermr Sep 15, 2024
6e238c9
Revert "try some edits"
beckermr Sep 15, 2024
c7b63d3
put in random dir
beckermr Sep 15, 2024
9eb4835
try some more
beckermr Sep 15, 2024
91a56ad
it is me
beckermr Sep 15, 2024
3fb9460
make a new comment if needed
beckermr Sep 15, 2024
4a28c72
try for new comment
beckermr Sep 15, 2024
56132a3
remove example
beckermr Sep 15, 2024
48f7882
test
beckermr Sep 15, 2024
8d6fe56
Revert "remove example"
beckermr Sep 15, 2024
72a82be
Reapply "remove example"
beckermr Sep 15, 2024
4dfe520
fix: rename to make shorter
beckermr Sep 15, 2024
161c0f8
Merge branch 'main' into unify-linting
beckermr Sep 16, 2024
214ea7e
Merge branch 'main' into unify-linting
beckermr Sep 16, 2024
ebfc8b3
fix: clarify logic and use last comment we find
beckermr Sep 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .github/workflows/correct_directory.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/do_not_edit_example.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: staged-recipes linter

on:
# this workflow requires access to a read-only github token
# and potentially runs untrusted code via python's `eval`
# thus we can only run it on pull_request events so that the
# the token does not have any write permissions
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linter:
name: linter
runs-on: ubuntu-latest
defaults:
run:
shell: bash -leo pipefail {0}

steps:
- name: checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: install code
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822
with:
environment-name: lint
condarc: |
show_channel_urls: true
channel_priority: strict
channels:
- conda-forge
create-args: >-
conda-smithy
pygithub
requests

- name: lint
run: |
python .github/workflows/scripts/linter.py \
--owner=${{ github.repository_owner }} \
--pr-num=${{ github.event.number }} \
>> $GITHUB_STEP_SUMMARY
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/linter_make_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: make comment for staged-recipes linter

on:
workflow_run:
workflows: ["staged-recipes linter"]
types:
- completed

jobs:
make-comment:
name: make comment
runs-on: ubuntu-latest
defaults:
run:
shell: bash -leo pipefail {0}

steps:
- name: checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: install code
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822
with:
environment-name: lint
condarc: |
show_channel_urls: true
channel_priority: strict
channels:
- conda-forge
create-args: >-
conda-smithy
pygithub
requests

- name: make comment
run: |
python .github/workflows/scripts/linter_make_comment.py \
--owner=${{ github.repository_owner }} \
--workflow-run-id=${{ github.event.workflow_run.id }} \
--head-sha=${{ github.event.workflow_run.head_sha }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 0 additions & 37 deletions .github/workflows/only_edit_in_recipes.yaml

This file was deleted.

Loading