forked from OntologyAlignmentProject/ontology
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lint: add basic ontology linting for structure and spelling
This commit starts to add additional linting for the OAP, in order to validate the structure and content of the documents. There are two pieces to this commit: * Structural linting uses yamale to validate the OAP data against yaml schema for equipment, points, and tags files. The schemas are based on the actual data present and so might not be exactly what the designers intended; but prevent indentation errors. * Spellchecking runs cspell on the text. Identifiers and other words must be added to lint/ids.txt or the build will fail. * Two github workflows which run these linters on commit. In the future, we should add additional check; eg to ensure each point has a definition (see OntologyAlignmentProject#2); but until that issue is closed the test would fail anyways.
- Loading branch information
Showing
10 changed files
with
1,146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
branches: | ||
- develop | ||
jobs: | ||
lint: | ||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | ||
runs-on: ubuntu-latest | ||
name: Run the linter on the dataset | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
- name: Install prereqs | ||
working-directory: lint | ||
run: pip install -r requirements.txt | ||
- name: Run linter | ||
working-directory: lint | ||
run: python lint.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
branches: | ||
- develop | ||
jobs: | ||
lint: | ||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | ||
runs-on: ubuntu-latest | ||
name: Run cspell on the dataset using our saved dictionary of ignore words | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install cspell | ||
working-directory: lint | ||
run: npm install -g cspell | ||
- name: Run spellcheck | ||
working-directory: lint | ||
run: cspell ../data/**/*.yaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"dictionaries": ["en_us", "ids"], | ||
"dictionaryDefinitions": [ | ||
{"name": "ids", "path": "./ids.txt"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
map(include("equip")) | ||
--- | ||
equip: | ||
name: str() | ||
description: str(required=False) | ||
short_name: str(required=False) | ||
haystack: include("haystack") | ||
extends: str(required=False) | ||
is_base: bool(required=False) | ||
contains: list(str(), required=False) | ||
attributes: list(str(), required=False) | ||
points: list(str(), required=False) | ||
points_base: list(str(), required=False) | ||
ifc_class: str(required=False) | ||
ifc_type: str(required=False) | ||
functions: list(str(), required=False) | ||
functions_base: list(str(), required=False) | ||
brick_ontology: str(required=False) | ||
google_ontology: str(required=False) | ||
deprecated: bool(required=False) | ||
kpi: list(str(), required=False) |
Oops, something went wrong.