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

Add automatic LinkML linting of schema on each PR #895

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
68283ae
Add VSCode settings to git ignore
jfy133 Nov 29, 2024
9f217c2
First pass on linkml validation github actions
jfy133 Nov 29, 2024
753f8e2
Try posting a message listing the issues
jfy133 Nov 29, 2024
fad8aea
Try adding permissions
jfy133 Nov 29, 2024
7077af8
Broad permissions
jfy133 Nov 29, 2024
15a5779
Reduce slightly permissions
jfy133 Nov 29, 2024
dca420a
Rename file
jfy133 Nov 29, 2024
64820af
Revert "Rename file"
jfy133 Nov 29, 2024
caa59f7
Make formatting prettier
jfy133 Nov 29, 2024
db5da9d
Use native linkML markdown and apply github pretty printing
jfy133 Nov 29, 2024
54e7ee1
Further formatting tweaks
jfy133 Nov 29, 2024
b296edb
Add debugging text
jfy133 Nov 29, 2024
4f1dd1c
Test
jfy133 Nov 29, 2024
5fd6299
Capture exit code
jfy133 Nov 29, 2024
cbccb45
Change the file again to trigger action
jfy133 Nov 29, 2024
4f2f52c
Reformat and post when failrure
jfy133 Nov 29, 2024
9f05a37
Make a change to the file to trigger action
jfy133 Nov 29, 2024
7982c65
Replace direct pip with poetry
jfy133 Dec 9, 2024
024f529
Try making collapsable blocks
jfy133 Dec 9, 2024
6a1db46
Merge branch 'automated-validation' of github.com:jfy133/genomics-sta…
jfy133 Dec 9, 2024
000cdaa
Add line referncing where rules are defined
jfy133 Dec 9, 2024
4baf112
Make change to trigger reformatting
jfy133 Dec 9, 2024
8054d81
Add a config for linting
jfy133 Dec 9, 2024
052f7e0
Make change to trigger action
jfy133 Dec 9, 2024
84a6937
Revert back to poetry as it's not working for whatever reason
jfy133 Dec 9, 2024
a29dc06
Make a change to trigger
jfy133 Dec 9, 2024
72f281f
Remove collapseable blocks because can't mix custom markdown with html
jfy133 Dec 9, 2024
e77de0b
Revert back to original reformatting sed command
jfy133 Dec 9, 2024
e06f5a9
Trigger change
jfy133 Dec 9, 2024
c0018e0
Try poetry again
jfy133 Dec 18, 2024
5f073a5
Trigger change for test comment purpsoes
jfy133 Dec 18, 2024
18c0666
Merge branch 'automated-validation' of github.com:jfy133/genomics-sta…
jfy133 Dec 18, 2024
e42fe22
Merge branch 'main' into automated-validation
jfy133 Jan 29, 2025
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
45 changes: 45 additions & 0 deletions .github/workflows/linkml-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: LinkML Linting GitHub Action
on:
push:
paths:
- "src/mixs/schema/mixs.yaml"
jobs:
linkml:
permissions:
contents: write
pull-requests: write
name: LinkML Linting
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/[email protected]

- name: Install dependencies
run: poetry install --no-interaction --no-root

- name: Run LinkML Linting
run: |
## Results file header and basic formatting
printf '# LinkML Linting Results \n\n' > linting-results.md
printf "$(linkml --version) linting found the following issues. \n\n" >> linting-results.md
printf "_For more information about the linting rule categories, see the [LinkML linter documentation](https://linkml.io/linkml/schemas/linter.html#rules)._\n" >> linting-results.md
## Lint the schema, and further format
poetry run linkml lint --config linkml-lint-config.yml --ignore-warnings -f markdown src/mixs/schema/mixs.yaml >> linting-results.md
- name: Reformat log
run: |
sed -i -e 's/#### Errors/> [!CAUTION]/' -e 's/#### Warnings/> [!WARNING]/' -e 's/^*/> */' -e '/###.*yaml/ s/$/\n/' -e '/###.*yaml/ s/^###/**File**:/' linting-results.md
- name: Post PR comment
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2
with:
message-path: linting-results.md
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: true
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,7 @@ dmypy.json
# Excel files dumped in project/excel
project/excel

.DS_Store
.DS_Store

.vscode/
linting-results*
4 changes: 4 additions & 0 deletions linkml-lint-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends: recommended
rules:
standard_naming:
level: disabled
Loading
Loading