Skip to content

Commit

Permalink
Merge pull request #1502 from google/copybara
Browse files Browse the repository at this point in the history
Project import generated by Copybara. Switch from PyLint to PyInk. Fixed Github actions for python code.
  • Loading branch information
shambergoldstein authored Feb 3, 2025
2 parents dfce5ff + 86e8a12 commit 5267c60
Show file tree
Hide file tree
Showing 136 changed files with 5,433 additions and 3,975 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/OntologyValidator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ jobs:
steps:
- name: Checkout the branch the PR is coming from if PR
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Checkout head if push
if: github.event_name == 'push'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -44,7 +44,7 @@ jobs:
- name: Get modified entity type files
id: changed-entity-type-files
if: github.event_name == 'push'
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v45
with:
files: '**/ontology/yaml/**/entity_types/*.yaml'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
Expand All @@ -43,22 +43,22 @@ jobs:
scoring:
- 'tools/scoring/**'
- name: Set up Python 3.11
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Pylint
- name: Install PyInk
run: |
python -m pip install pylint
python -m pip install pyink
#---------- Ontology Yaml Type Validator ----------#
- name: Ontology Yaml Type Validator Install dependencies
run: |
python setup.py install
working-directory: ./tools/validators/ontology_validator
- name: Run pylint on Ontology Type Validator
- name: Run PyInk on Ontology Type Validator
if: steps.changes.outputs.type_validator == 'true'
run: |
pylint --rcfile ./styles/pylintrc ./tools/validators/ontology_validator
pyink --diff --config ./styles/pyink-config ./tools/validators/ontology_validator
- name: Ontology Yaml Validator Generator Tests
if: steps.changes.outputs.type_validator == 'true'
run: |
Expand All @@ -70,10 +70,10 @@ jobs:
run: |
python -m pip install .
working-directory: ./tools/validators/instance_validator
- name: Run pylint on Ontology Instance Validator
- name: Run PyInk on Ontology Instance Validator
if: steps.changes.outputs.instance_validator == 'true'
run: |
pylint --rcfile ./styles/pylintrc ./tools/validators/instance_validator
pyink --diff --config ./styles/pyink-config ./tools/validators/instance_validator
- name: Instance Yaml Validator Unit Tests
if: steps.changes.outputs.instance_validator == 'true' || steps.changes.outputs.type_validator == 'true'
run: |
Expand All @@ -96,10 +96,10 @@ jobs:
run: |
python setup.py install
working-directory: ./tools/abel
- name: Run pylint on ABEL
- name: Run PyInk on ABEL
if: steps.changes.outputs.abel == 'true'
run: |
pylint --rcfile ./styles/pylintrc ./tools/abel
pyink --diff --config ./styles/pyink-config ./tools/abel
- name: ABEL Unit Tests
if: steps.changes.outputs.abel == 'true' || steps.changes.outputs.instance_validator == 'true' || steps.changes.outputs.type_validator == 'true'
run: |
Expand All @@ -112,10 +112,10 @@ jobs:
run: |
python setup.py install
working-directory: ./tools/guid_generator/instance
- name: Run pylint on Instance GUID Generator
- name: Run PyInk on Instance GUID Generator
if: steps.changes.outputs.instance_guid_generator == 'true'
run: |
pylint --rcfile ./styles/pylintrc ./tools/guid_generator/instance
pyink --diff --config ./styles/pyink-config ./tools/guid_generator/instance
- name: Instance GUID Generator Tests
if: steps.changes.outputs.instance_guid_generator == 'true' || steps.changes.outputs.instance_validator == 'true'
run: |
Expand All @@ -128,10 +128,10 @@ jobs:
run: |
python setup.py install
working-directory: ./tools/guid_generator/ontology
- name: Run pylint on Ontology GUID Generator
- name: Run PyInk on Ontology GUID Generator
if: steps.changes.outputs.ontology_guid_generator == 'true'
run: |
pylint --rcfile ./styles/pylintrc ./tools/guid_generator/ontology
pyink --diff --config ./styles/pyink-config ./tools/guid_generator/ontology
- name: Ontology GUID Generator Tests
if: steps.changes.outputs.ontology_guid_generator == 'true' || steps.changes.outputs.type_validator == 'true'
run: |
Expand All @@ -145,10 +145,10 @@ jobs:
python -m pip install --upgrade pip
python setup.py install
working-directory: ./tools/rdf_generator
- name: Run pylint on RDF Generator
- name: Run PyInk on RDF Generator
if: steps.changes.outputs.rdf_generator == 'true'
run: |
pylint --rcfile ./styles/pylintrc ./tools/rdf_generator
pyink --diff --config ./styles/pyink-config ./tools/rdf_generator
- name: RDF Generator Tests
if: steps.changes.outputs.rdf_generator == 'true'
run: |
Expand All @@ -161,10 +161,10 @@ jobs:
run: |
python setup.py install
working-directory: ./tools/explorer
- name: Run pylint on Ontology Explorer
- name: Run PyInk on Ontology Explorer
if: steps.changes.outputs.explorer == 'true'
run: |
pylint --rcfile ./styles/pylintrc ./tools/explorer
pyink --diff --config ./styles/pyink-config ./tools/explorer
- name: Ontology Explorer Tests
if: steps.changes.outputs.explorer == 'true' || steps.changes.outputs.type_validator == 'true' || steps.changes.outputs.instance_validator == 'true'
run: |
Expand All @@ -177,10 +177,10 @@ jobs:
run: |
python setup.py install
working-directory: ./tools/scoring
- name: Run pylint on Configuration Scorer
- name: Run PyInk on Configuration Scorer
if: steps.changes.outputs.scoring == 'true'
run: |
pylint --rcfile ./styles/pylintrc ./tools/scoring
pyink --diff --config ./styles/pyink-config ./tools/scoring
- name: Configuration Scorer Tests
if: steps.changes.outputs.scoring == 'true' || steps.changes.outputs.instance_validator == 'true'
run: |
Expand Down
7 changes: 7 additions & 0 deletions styles/pyink-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tool.pyink]
pyink = true
line-length = 80
pyink-indentation = 2
pyink-use-majority-quotes = true
preview = true
unstable = true
Loading

0 comments on commit 5267c60

Please sign in to comment.