Skip to content

Commit 08101db

Browse files
authored
Add linting for TSV and MD (#36)
1 parent 432f687 commit 08101db

4 files changed

Lines changed: 142 additions & 69 deletions

File tree

.github/workflows/lint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This file configures the continuous integration (CI) system on GitHub.
2+
# Introductory materials can be found here: https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions.
3+
# Documentation for editing this file can be found here: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
4+
5+
name: Lint
6+
7+
# by default, give the GITHUB_TOKEN no permissions
8+
# See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
9+
permissions: { }
10+
11+
on:
12+
push:
13+
branches: [ main ]
14+
pull_request:
15+
branches: [ main ]
16+
17+
jobs:
18+
lint:
19+
name: Lint
20+
permissions:
21+
contents: read
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
python-version: [ "3.14" ]
26+
steps:
27+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
28+
with:
29+
persist-credentials: false
30+
31+
- name: Lint Markdown
32+
run: npx --yes prettier --check --prose-wrap always "**/*.md"
33+
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
36+
37+
- name: Lint TSV
38+
run: uv run --script lint.py

README.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,39 @@
11
# SEMAPV: A Vocabulary for Semantic Mappings
22

3-
The Semantic Mapping Vocabulary (SEMAPV) is a vocabulary about the processes, entities and agents involved in the curation of mappings. It is being developed in conjunction with the [Simple Standard for Sharing Ontology Mappings (SSSOM)](https://mapping-commons.github.io/sssom/spec/), providing a detailed vocabulary to describe, for example, different kinds of matching processes (lexical, logical, etc), as well as pre- and post-processing techniques employed.
3+
The Semantic Mapping Vocabulary (SEMAPV) is a vocabulary about the processes,
4+
entities and agents involved in the curation of mappings. It is being developed
5+
in conjunction with the
6+
[Simple Standard for Sharing Ontology Mappings (SSSOM)](https://mapping-commons.github.io/sssom/spec/),
7+
providing a detailed vocabulary to describe, for example, different kinds of
8+
matching processes (lexical, logical, etc.), as well as pre- and post-processing
9+
techniques employed.
410

511
To cite: http://doi.org/10.5281/zenodo.7672104
612

713
**SEMAPV is currently in beta state and is likely still undergoing changes.**
814

9-
### Core editorial Team
15+
### Core Editorial Team
1016

11-
* [Nicolas Matentzoglu](https://orcid.org/0000-0002-7356-1779) (Semanticly Ltd; [@matentzn](https://github.com/matentzn))
12-
* [Chris Mungall](https://orcid.org/0000-0002-6601-2165) (LBL; [@cmungall](https://github.com/matentzn))
13-
* [Ernesto Jimenez-Ruiz](https://orcid.org/0000-0002-9083-4599) (City, University of London)
14-
* [Catia Pesquita](https://orcid.org/0000-0002-1847-9393) (University of Lisbon)
15-
* [John Graybeal](https://orcid.org/0000-0001-6875-5360) (Stanford)
16-
* [Charlie Hoyt](https://orcid.org/0000-0003-4423-4370) (Harvard Medical School; [@cthoyt](https://github.com/cthoyt))
17-
* [Thomas Liener](https://orcid.org/0000-0003-3257-9937) (Pistoia Alliance)
17+
- [Nicolas Matentzoglu](https://orcid.org/0000-0002-7356-1779) (Semanticly Ltd;
18+
[@matentzn](https://github.com/matentzn))
19+
- [Chris Mungall](https://orcid.org/0000-0002-6601-2165) (LBL;
20+
[@cmungall](https://github.com/cmungall))
21+
- [Ernesto Jimenez-Ruiz](https://orcid.org/0000-0002-9083-4599) (City,
22+
University of London)
23+
- [Catia Pesquita](https://orcid.org/0000-0002-1847-9393) (University of Lisbon)
24+
- [John Graybeal](https://orcid.org/0000-0001-6875-5360) (Stanford)
25+
- [Charlie Hoyt](https://orcid.org/0000-0003-4423-4370) (RWTH Aachen University;
26+
[@cthoyt](https://github.com/cthoyt))
27+
- [Thomas Liener](https://orcid.org/0000-0003-3257-9937) (Pistoia Alliance)
1828

19-
Please join the team by making an issue in the [issue tracker](https://github.com/mapping-commons/semantic-mapping-vocabulary/issues).
29+
Please join the team by making an issue in the
30+
[issue tracker](https://github.com/mapping-commons/semantic-mapping-vocabulary/issues).
2031

2132
### Overview
2233

2334
A snapshot of the current SEMAPV hierarchy can be seen here:
2435

2536
<img width="461" alt="image" src="https://user-images.githubusercontent.com/7070631/169400247-3873c86d-5761-4609-8a86-8007542cf868.png">
2637

27-
A preliminary [LODE](https://github.com/rdflib/pyLODE) documentation can be found here: https://mapping-commons.github.io/semantic-mapping-vocabulary/.
38+
A preliminary [LODE](https://github.com/rdflib/pyLODE) documentation can be
39+
found here: https://mapping-commons.github.io/semantic-mapping-vocabulary/.

lint.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# /// script
2+
# requires-python = ">=3.14"
3+
# dependencies = [
4+
# "pandas>=3.0.3",
5+
# ]
6+
# ///
7+
8+
import sys
9+
from pathlib import Path
10+
11+
import pandas as pd
12+
13+
HERE = Path(__file__).parent.resolve()
14+
15+
if __name__ == "__main__":
16+
fail = False
17+
for path in HERE.glob("*.tsv"):
18+
original = path.read_text()
19+
corrected = pd.read_csv(path, sep="\t").to_csv(sep="\t", index=False)
20+
if original != corrected:
21+
print(f"TSV not formatted properly: {path}")
22+
fail = True
23+
sys.exit(1 if fail else 0)

0 commit comments

Comments
 (0)