Skip to content

Commit 5267c60

Browse files
Merge pull request #1502 from google/copybara
Project import generated by Copybara. Switch from PyLint to PyInk. Fixed Github actions for python code.
2 parents dfce5ff + 86e8a12 commit 5267c60

File tree

136 files changed

+5433
-3975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+5433
-3975
lines changed

.github/workflows/OntologyValidator.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ jobs:
2020
steps:
2121
- name: Checkout the branch the PR is coming from if PR
2222
if: github.event_name == 'pull_request'
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
with:
2525
repository: ${{ github.event.pull_request.head.repo.full_name }}
2626
ref: ${{ github.event.pull_request.head.ref }}
2727

2828
- name: Checkout head if push
2929
if: github.event_name == 'push'
30-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
3131

3232
- name: Set up Python 3.11
33-
uses: actions/setup-python@v1
33+
uses: actions/setup-python@v5
3434
with:
3535
python-version: '3.11'
3636

@@ -44,7 +44,7 @@ jobs:
4444
- name: Get modified entity type files
4545
id: changed-entity-type-files
4646
if: github.event_name == 'push'
47-
uses: tj-actions/changed-files@v41
47+
uses: tj-actions/changed-files@v45
4848
with:
4949
files: '**/ontology/yaml/**/entity_types/*.yaml'
5050

.github/workflows/node.js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
node-version: [10.x, 12.x, 14.x]
2828

2929
steps:
30-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v4
3131
- name: Use Node.js ${{ matrix.node-version }}
32-
uses: actions/setup-node@v1
32+
uses: actions/setup-node@v4
3333
with:
3434
node-version: ${{ matrix.node-version }}
3535

.github/workflows/tools.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
matrix:
2222
os: [macos-latest, ubuntu-latest, windows-latest]
2323
steps:
24-
- uses: actions/checkout@v2
25-
- uses: dorny/paths-filter@v2
24+
- uses: actions/checkout@v4
25+
- uses: dorny/paths-filter@v3
2626
id: changes
2727
with:
2828
filters: |
@@ -43,22 +43,22 @@ jobs:
4343
scoring:
4444
- 'tools/scoring/**'
4545
- name: Set up Python 3.11
46-
uses: actions/setup-python@v1
46+
uses: actions/setup-python@v5
4747
with:
4848
python-version: '3.11'
49-
- name: Install Pylint
49+
- name: Install PyInk
5050
run: |
51-
python -m pip install pylint
51+
python -m pip install pyink
5252
5353
#---------- Ontology Yaml Type Validator ----------#
5454
- name: Ontology Yaml Type Validator Install dependencies
5555
run: |
5656
python setup.py install
5757
working-directory: ./tools/validators/ontology_validator
58-
- name: Run pylint on Ontology Type Validator
58+
- name: Run PyInk on Ontology Type Validator
5959
if: steps.changes.outputs.type_validator == 'true'
6060
run: |
61-
pylint --rcfile ./styles/pylintrc ./tools/validators/ontology_validator
61+
pyink --diff --config ./styles/pyink-config ./tools/validators/ontology_validator
6262
- name: Ontology Yaml Validator Generator Tests
6363
if: steps.changes.outputs.type_validator == 'true'
6464
run: |
@@ -70,10 +70,10 @@ jobs:
7070
run: |
7171
python -m pip install .
7272
working-directory: ./tools/validators/instance_validator
73-
- name: Run pylint on Ontology Instance Validator
73+
- name: Run PyInk on Ontology Instance Validator
7474
if: steps.changes.outputs.instance_validator == 'true'
7575
run: |
76-
pylint --rcfile ./styles/pylintrc ./tools/validators/instance_validator
76+
pyink --diff --config ./styles/pyink-config ./tools/validators/instance_validator
7777
- name: Instance Yaml Validator Unit Tests
7878
if: steps.changes.outputs.instance_validator == 'true' || steps.changes.outputs.type_validator == 'true'
7979
run: |
@@ -96,10 +96,10 @@ jobs:
9696
run: |
9797
python setup.py install
9898
working-directory: ./tools/abel
99-
- name: Run pylint on ABEL
99+
- name: Run PyInk on ABEL
100100
if: steps.changes.outputs.abel == 'true'
101101
run: |
102-
pylint --rcfile ./styles/pylintrc ./tools/abel
102+
pyink --diff --config ./styles/pyink-config ./tools/abel
103103
- name: ABEL Unit Tests
104104
if: steps.changes.outputs.abel == 'true' || steps.changes.outputs.instance_validator == 'true' || steps.changes.outputs.type_validator == 'true'
105105
run: |
@@ -112,10 +112,10 @@ jobs:
112112
run: |
113113
python setup.py install
114114
working-directory: ./tools/guid_generator/instance
115-
- name: Run pylint on Instance GUID Generator
115+
- name: Run PyInk on Instance GUID Generator
116116
if: steps.changes.outputs.instance_guid_generator == 'true'
117117
run: |
118-
pylint --rcfile ./styles/pylintrc ./tools/guid_generator/instance
118+
pyink --diff --config ./styles/pyink-config ./tools/guid_generator/instance
119119
- name: Instance GUID Generator Tests
120120
if: steps.changes.outputs.instance_guid_generator == 'true' || steps.changes.outputs.instance_validator == 'true'
121121
run: |
@@ -128,10 +128,10 @@ jobs:
128128
run: |
129129
python setup.py install
130130
working-directory: ./tools/guid_generator/ontology
131-
- name: Run pylint on Ontology GUID Generator
131+
- name: Run PyInk on Ontology GUID Generator
132132
if: steps.changes.outputs.ontology_guid_generator == 'true'
133133
run: |
134-
pylint --rcfile ./styles/pylintrc ./tools/guid_generator/ontology
134+
pyink --diff --config ./styles/pyink-config ./tools/guid_generator/ontology
135135
- name: Ontology GUID Generator Tests
136136
if: steps.changes.outputs.ontology_guid_generator == 'true' || steps.changes.outputs.type_validator == 'true'
137137
run: |
@@ -145,10 +145,10 @@ jobs:
145145
python -m pip install --upgrade pip
146146
python setup.py install
147147
working-directory: ./tools/rdf_generator
148-
- name: Run pylint on RDF Generator
148+
- name: Run PyInk on RDF Generator
149149
if: steps.changes.outputs.rdf_generator == 'true'
150150
run: |
151-
pylint --rcfile ./styles/pylintrc ./tools/rdf_generator
151+
pyink --diff --config ./styles/pyink-config ./tools/rdf_generator
152152
- name: RDF Generator Tests
153153
if: steps.changes.outputs.rdf_generator == 'true'
154154
run: |
@@ -161,10 +161,10 @@ jobs:
161161
run: |
162162
python setup.py install
163163
working-directory: ./tools/explorer
164-
- name: Run pylint on Ontology Explorer
164+
- name: Run PyInk on Ontology Explorer
165165
if: steps.changes.outputs.explorer == 'true'
166166
run: |
167-
pylint --rcfile ./styles/pylintrc ./tools/explorer
167+
pyink --diff --config ./styles/pyink-config ./tools/explorer
168168
- name: Ontology Explorer Tests
169169
if: steps.changes.outputs.explorer == 'true' || steps.changes.outputs.type_validator == 'true' || steps.changes.outputs.instance_validator == 'true'
170170
run: |
@@ -177,10 +177,10 @@ jobs:
177177
run: |
178178
python setup.py install
179179
working-directory: ./tools/scoring
180-
- name: Run pylint on Configuration Scorer
180+
- name: Run PyInk on Configuration Scorer
181181
if: steps.changes.outputs.scoring == 'true'
182182
run: |
183-
pylint --rcfile ./styles/pylintrc ./tools/scoring
183+
pyink --diff --config ./styles/pyink-config ./tools/scoring
184184
- name: Configuration Scorer Tests
185185
if: steps.changes.outputs.scoring == 'true' || steps.changes.outputs.instance_validator == 'true'
186186
run: |

styles/pyink-config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[tool.pyink]
2+
pyink = true
3+
line-length = 80
4+
pyink-indentation = 2
5+
pyink-use-majority-quotes = true
6+
preview = true
7+
unstable = true

0 commit comments

Comments
 (0)