Skip to content

Commit 42f4441

Browse files
timvanTapdancingRodentMona Bhardwaj
authored
github-migration/master (#1)
'Auto Generated PR for github-migration/master. See https://graphcore.atlassian.net/l/cp/qD91gp3B' --------- Co-authored-by: timv <timv@graphcore.ai> Co-authored-by: Dan Hewitt <danh@graphcore.ai> Co-authored-by: Mona Bhardwaj <monab@graphcore.ai>
1 parent c517deb commit 42f4441

File tree

6 files changed

+62
-178
lines changed

6 files changed

+62
-178
lines changed

.arcconfig

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@Library('sw-jenkins-library@view-component-trigger') _
2+
3+
viewComponentTrigger(jobsFilepath: '.ci/view_component_trigger/jobs.groovy')
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
[job: '/poplar/poplar_pr', parameters: [string(name: 'GCCI_BRANCH', value: 'mk2-main')]],
3+
]

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @Software-GCAI/popart

.github/workflows/pre-commit.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ["self-hosted", "linux"]
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0 # Required for us to have a valid ref to the target branch
17+
- uses: actions/setup-python@v3
18+
- uses: actions/cache@v3
19+
with:
20+
path: ~/.cache/pre-commit/
21+
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
22+
- uses: webfactory/ssh-agent@v0.8.0
23+
with:
24+
ssh-private-key: ${{ secrets.PRE_COMMIT_SCRIPTS_DEPLOY_KEY }}
25+
- name: SSH Keys and known_hosts
26+
run: |
27+
mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts
28+
ssh-keyscan github.com >> ~/.ssh/known_hosts
29+
- uses: pre-commit/action@v3.0.0
30+
with:
31+
extra_args: "--from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}"

.pre-commit-config.yaml

Lines changed: 24 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,25 @@
1-
# Copyright (c) 2022 Graphcore Ltd. All rights reserved.
2-
---
3-
exclude: |
4-
(?x)^(
5-
build_scripts/.*|
6-
willow/include/popart/vendored/.*|
7-
.arclint|
8-
.arcconfig|
9-
.buildignore|
10-
.clang-format|
11-
.*Doxyfile.in|
12-
.*LICENSE|
13-
.*.drawio|
14-
.*.json|
15-
.*.md|
16-
.*.png|
17-
.*.pdf|
18-
.*.rst
19-
)$
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
203
repos:
21-
- repo: local
22-
hooks:
23-
- id: version-checker
24-
name: Version checker
25-
description: Ensures that the correct version of the linters are used.
26-
entry: python3 -m scripts.lint.linters.check_versions
27-
language: python
28-
exclude: ".*" # Does not run on files
29-
always_run: true
30-
fail_fast: true
31-
additional_dependencies:
32-
- pyyaml
33-
- id: copyright-linter
34-
name: Copyright linter
35-
description: Ensures that files have the proper copyright line.
36-
entry: python3 -m scripts.lint.linters.copyright_linter
37-
language: python
38-
exclude: tests/integration/operators_test/rnn_helper.py
39-
additional_dependencies:
40-
# dataclasses was introduced in Python 3.7
41-
# For python 3.6 it therefore needs to be added as a dependency
42-
- dataclasses
43-
- id: popart-test-linter
44-
name: PopART test-linter
45-
description: |
46-
checks that pytest test files have a corresponding
47-
`add_popart_py_unit_test` entry in a neighbouring CMakeLists.txt
48-
file
49-
entry: python3 -m scripts.lint.linters.check_python_test_has_cmake_entry
50-
language: python
51-
files: .*.py
52-
exclude: |
53-
(?x)^(
54-
tests/integration/operators_test/scatterreduce_test_basic.py |
55-
docs/popart/files/tests/test_popart_doc_examples_custom_op.py|
56-
docs/popart/files/tests/test_popart_doc_examples.py|
57-
docs/popxl/files/tests/test_popxl_doc_examples_custom_op.py|
58-
docs/popxl/files/tests/test_popxl_doc_examples.py|
59-
docs/popxl/files/mnist.py|
60-
docs/popxl/files/mnist_rts.py|
61-
tests/linters/.*
62-
)$
63-
# Note: pylint to be run locally:
64-
# https://pylint.pycqa.org/en/latest/user_guide/pre-commit-integration.html
65-
- id: pylint
66-
name: pylint
67-
entry: pylint
68-
language: system
69-
types: [python]
70-
# -j 1 is needed for the linter not to hang
71-
# https://github.com/PyCQA/pylint/issues/3899
72-
args:
73-
[
74-
--rcfile=scripts/lint/linters/pylintrc,
75-
-j 1
76-
]
77-
- repo: https://github.com/pre-commit/pre-commit-hooks
78-
rev: v2.3.0
79-
hooks:
80-
- id: check-yaml
81-
# This file starts with @ which is a reserved yml character
82-
exclude: popart.prodinfo.yml
83-
- id: check-json
84-
- id: check-merge-conflict
85-
- id: debug-statements
86-
- id: end-of-file-fixer
87-
- id: mixed-line-ending
88-
- id: trailing-whitespace
89-
- repo: https://github.com/psf/black
90-
rev: 21.12b0
91-
hooks:
92-
- id: black
93-
additional_dependencies:
94-
- click==8.0.4
95-
# Prevent an error with the current version of black and Python version >3.6 (D73000).
96-
- repo: https://github.com/asottile/blacken-docs
97-
rev: v1.12.0
98-
hooks:
99-
- id: blacken-docs
100-
additional_dependencies:
101-
- black==21.12b0
102-
- repo: https://github.com/pycqa/pydocstyle
103-
rev: 6.1.1
104-
hooks:
105-
- id: pydocstyle
106-
# Tests are currently emitting a lot of errors, will be fixed at a later stage
107-
exclude: tests/
108-
args:
109-
# See explanation of error codes at http://www.pydocstyle.org/en/6.1.1/error_codes.html
110-
# By using select, most checking is ignored
111-
# This can be checked when enough errors has been fixed
112-
- |-
113-
--select=
114-
D400,
115-
D401
116-
- repo: https://github.com/pocc/pre-commit-hooks
117-
rev: v1.3.5
118-
hooks:
119-
# Install with pip3 install clang-format==9.0.0
120-
- id: clang-format
121-
args: [
122-
-i, # Fix inplace
123-
--style=file # Use .clang-tidy
124-
]
125-
# - id: clang-tidy
126-
# - id: oclint
127-
# - id: uncrustify
128-
- id: cppcheck
129-
args: [
130-
--inline-suppr,
131-
--suppressions-list=scripts/lint/linters/cppcheck-suppressions-list.txt
132-
]
133-
- id: cpplint
134-
# This check clashes with clang-format
135-
args: [
136-
'--filter=-,-build/header_guard'
137-
]
138-
exclude: |
139-
(?x)^(
140-
willow/include/popart/docs/pydocs_popart_core.hpp|
141-
willow/include/popart/builder.gen.hpp|
142-
willow/include/popart/onnxoperators.gen.hpp|
143-
willow/src/opsets.gen.hpp
144-
)$
145-
146-
- repo: local
147-
hooks:
148-
# The clone linter should run after the format linters so that it only works on formatted files
149-
- id: clone-linter
150-
name: Clone linter
151-
description: Ensures that all Ops implements a clone().
152-
entry: python3 -m scripts.lint.linters.clone_linter
153-
language: python
154-
files: "willow/include/popart/op/.*.hpp"
155-
# - id: iwyu
156-
# language: script
157-
# name: Include what you use
158-
# types: [c++]
159-
# entry: scripts/lint/linters/iwyu/include_what_you_use_linter.sh
160-
# # verify_cxx_11_interface.cpp is excluded as it relies on files generated
161-
# # during build
162-
# # opidentifier.hpp is deprecated and should be kept as is until removed
163-
# # willow/include/popart/vendored/ contains external files, should avoid
164-
# # changing them
165-
# exclude: >
166-
# (?x)^(
167-
# tests/integration/verify_cxx_11_interface/verify_cxx_11_interface.cpp|
168-
# willow/include/popart/opidentifier.hpp|
169-
# willow/include/popart/vendored/
170-
# )$
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.2.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-json
10+
- id: check-added-large-files
11+
- repo: https://github.com/pocc/pre-commit-hooks
12+
rev: v1.3.5
13+
hooks:
14+
- id: clang-format
15+
additional_dependencies: [clang-format==16.0.6]
16+
files: \.(c|cpp|h|hpp)$
17+
- repo: https://github.com/pre-commit/mirrors-yapf
18+
rev: v0.32.0
19+
hooks:
20+
- id: yapf
21+
types: [python]
22+
- repo: ssh://git@github.com/Software-GCAI/precommit-scripts
23+
rev: v1.0.1
24+
hooks:
25+
- id: gc-copyright

0 commit comments

Comments
 (0)