Skip to content

Commit

Permalink
CI: yamllint (pyg-team#3886)
Browse files Browse the repository at this point in the history
* yamllint

* update

* update

* typo
  • Loading branch information
rusty1s authored Jan 19, 2022
1 parent 3a52d5a commit 0805d05
Show file tree
Hide file tree
Showing 19 changed files with 193 additions and 167 deletions.
104 changes: 52 additions & 52 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,55 @@ description: "Submit a report to help us reproduce and fix the bug"
labels: bug

body:
- type: markdown
attributes:
value: >
#### Before submitting a bug, please make sure the issue hasn't been already addressed by searching through [the existing and past issues](https://github.com/pyg-team/pytorch_geometric/issues).
#
- type: textarea
attributes:
label: 🐛 Describe the bug
description: |
Please provide a clear and concise description of the bug.
If relevant, add a minimal example so that we can reproduce the error by running the code. It is very important for the snippet to be as minimal as possible, so please take time to trim down any irrelevant code to help us debug efficiently. We are going to copy-paste your code and we expect to get the same result as you did: avoid any external data, and include the relevant imports:
```python
# All necessary imports at the beginning
import torch
from torch_geometric.utils import to_undirected
# A minimal reproducing example trimmed down to the essential parts:
edge_index = torch.tensor([[0, 1, 2], [1, 2, 3]])
edge_index = to_undirected(edge_index, num_nodes=1)
assert edge_index.size(1) == 6 # We expect that the number of edges is doubled.
# NOTE: the bug is that num_nodes < edge_index.max() + 1
```
Please also paste or describe the results you observe instead of the expected results. If you observe an error, please paste the error message including the **full** traceback of the exception. It may be relevant to wrap error messages in ```` ```triple quotes blocks``` ````.
placeholder: |
A clear and concise description of the bug.
```python
# Sample code to reproduce the problem
```
```
The error message you got, with the full traceback.
```
validations:
required: true
- type: textarea
attributes:
label: Environment
description: |
Please provide as much information as possible about your environment, such as your PyG (`print(torch_geometric.__version__)`) and PyTorch version (`print(torch.__version__)`), your OS (*e.g.*, Linux), and your Python version (*e.g.*, `3.9`):
value: |
* PyG version:
* PyTorch version:
* OS:
* Python version:
* CUDA/cuDNN version:
* How you installed PyTorch and PyG (`conda`, `pip`, source):
* Any other relevant information (*e.g.*, version of `torch-scatter`):
- type: markdown
attributes:
value: >
#### Before submitting a bug, please make sure the issue hasn't been already addressed by searching through [the existing and past issues](https://github.com/pyg-team/pytorch_geometric/issues).
#
- type: textarea
attributes:
label: 🐛 Describe the bug
description: |
Please provide a clear and concise description of the bug.
If relevant, add a minimal example so that we can reproduce the error by running the code. It is very important for the snippet to be as minimal as possible, so please take time to trim down any irrelevant code to help us debug efficiently. We are going to copy-paste your code and we expect to get the same result as you did: avoid any external data, and include the relevant imports:
```python
# All necessary imports at the beginning
import torch
from torch_geometric.utils import to_undirected
# A minimal reproducing example trimmed down to the essential parts:
edge_index = torch.tensor([[0, 1, 2], [1, 2, 3]])
edge_index = to_undirected(edge_index, num_nodes=1)
assert edge_index.size(1) == 6 # We expect that the number of edges is doubled.
# NOTE: the bug is that num_nodes < edge_index.max() + 1
```
Please also paste or describe the results you observe instead of the expected results. If you observe an error, please paste the error message including the **full** traceback of the exception. It may be relevant to wrap error messages in ```` ```triple quotes blocks``` ````.
placeholder: |
A clear and concise description of the bug.
```python
# Sample code to reproduce the problem
```
```
The error message you got, with the full traceback.
```
validations:
required: true
- type: textarea
attributes:
label: Environment
description: |
Please provide as much information as possible about your environment, such as your PyG (`print(torch_geometric.__version__)`) and PyTorch version (`print(torch.__version__)`), your OS (*e.g.*, Linux), and your Python version (*e.g.*, `3.9`):
value: |
* PyG version:
* PyTorch version:
* OS:
* Python version:
* CUDA/cuDNN version:
* How you installed PyTorch and PyG (`conda`, `pip`, source):
* Any other relevant information (*e.g.*, version of `torch-scatter`):
24 changes: 12 additions & 12 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ description: "Tell us about how we can improve our documentation"
labels: documentation

body:
- type: textarea
attributes:
label: 📚 Describe the documentation issue
description: |
A clear and concise description of the issue.
validations:
required: true
- type: textarea
attributes:
label: Suggest a potential alternative/fix
description: |
Tell us how we could improve the documentation in this regard.
- type: textarea
attributes:
label: 📚 Describe the documentation issue
description: |
A clear and concise description of the issue.
validations:
required: true
- type: textarea
attributes:
label: Suggest a potential alternative/fix
description: |
Tell us how we could improve the documentation in this regard.
34 changes: 17 additions & 17 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ description: "Propose a new PyG feature"
labels: feature

body:
- type: textarea
attributes:
label: 🚀 The feature, motivation and pitch
description: >
A clear and concise description of the feature proposal. Please outline the motivation for the proposal. Is your feature request related to a specific problem? e.g., *"I'm working on X and would like Y to be possible"*. If this is related to another GitHub issue, please link here too.
validations:
required: true
- type: textarea
attributes:
label: Alternatives
description: >
A description of any alternative solutions or features you've considered, if any.
- type: textarea
attributes:
label: Additional context
description: >
Add any other context or screenshots about the feature request.
- type: textarea
attributes:
label: 🚀 The feature, motivation and pitch
description: >
A clear and concise description of the feature proposal. Please outline the motivation for the proposal. Is your feature request related to a specific problem? e.g., *"I'm working on X and would like Y to be possible"*. If this is related to another GitHub issue, please link here too.
validations:
required: true
- type: textarea
attributes:
label: Alternatives
description: >
A description of any alternative solutions or features you've considered, if any.
- type: textarea
attributes:
label: Additional context
description: >
Add any other context or screenshots about the feature request.
54 changes: 27 additions & 27 deletions .github/ISSUE_TEMPLATE/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ description: "Report an installation problem"
labels: installation

body:
- type: markdown
attributes:
value: >
#### Before submitting an installation problem, please make sure the issue hasn't been already reported by searching through [the existing and past issues](https://github.com/pyg-team/pytorch_geometric/issues).
#
- type: textarea
attributes:
label: 😵 Describe the installation problem
description: |
Please provide a clear and concise description of the installation problem. If you have installation log files, please prvoide them here as well. It may be relevant to wrap the log files in ```` ```triple quotes blocks``` ````.
placeholder: |
A clear and concise description of the installation problem.
validations:
required: true
- type: textarea
attributes:
label: Environment
description: |
Please provide as much information as possible about your environment, such as your PyG (`print(torch_geometric.__version__)`) and PyTorch version (`print(torch.__version__)`), your OS (*e.g.*, Linux), and your Python version (*e.g.*, `3.9`):
value: |
* PyG version:
* PyTorch version:
* OS:
* Python version:
* CUDA/cuDNN version:
* How you installed PyTorch and PyG (`conda`, `pip`, source):
* Any other relevant information (*e.g.*, version of `torch-scatter`):
- type: markdown
attributes:
value: >
#### Before submitting an installation problem, please make sure the issue hasn't been already reported by searching through [the existing and past issues](https://github.com/pyg-team/pytorch_geometric/issues).
#
- type: textarea
attributes:
label: 😵 Describe the installation problem
description: |
Please provide a clear and concise description of the installation problem. If you have installation log files, please prvoide them here as well. It may be relevant to wrap the log files in ```` ```triple quotes blocks``` ````.
placeholder: |
A clear and concise description of the installation problem.
validations:
required: true
- type: textarea
attributes:
label: Environment
description: |
Please provide as much information as possible about your environment, such as your PyG (`print(torch_geometric.__version__)`) and PyTorch version (`print(torch.__version__)`), your OS (*e.g.*, Linux), and your Python version (*e.g.*, `3.9`):
value: |
* PyG version:
* PyTorch version:
* OS:
* Python version:
* CUDA/cuDNN version:
* How you installed PyTorch and PyG (`conda`, `pip`, source):
* Any other relevant information (*e.g.*, version of `torch-scatter`):
28 changes: 14 additions & 14 deletions .github/ISSUE_TEMPLATE/refactor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ description: "Suggest a code refactor or deprecation"
labels: refactor

body:
- type: textarea
attributes:
label: 🛠 Proposed Refactor
description: |
A clear and concise description of the refactor proposal. Please outline the motivation for the proposal. If this is related to another GitHub issue, please link here too.
validations:
required: true
- type: textarea
attributes:
label: Suggest a potential alternative/fix
description: |
Tell us how we could improve the code in this regard.
validations:
required: true
- type: textarea
attributes:
label: 🛠 Proposed Refactor
description: |
A clear and concise description of the refactor proposal. Please outline the motivation for the proposal. If this is related to another GitHub issue, please link here too.
validations:
required: true
- type: textarea
attributes:
label: Suggest a potential alternative/fix
description: |
Tell us how we could improve the code in this regard.
validations:
required: true
2 changes: 1 addition & 1 deletion .github/workflows/building-pyg-conda.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Building PyG Conda

on: [workflow_dispatch]
on: [workflow_dispatch] # yamllint disable-line rule:truthy

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/building-rusty1s-conda.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Building rusty1s Conda

on: [workflow_dispatch]
on: [workflow_dispatch] # yamllint disable-line rule:truthy

jobs:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Documentation

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- master
Expand Down
37 changes: 28 additions & 9 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Linting

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- master
Expand All @@ -27,7 +27,7 @@ jobs:
run: |
flake8 .
pylint:
pyroma:
runs-on: ubuntu-latest

steps:
Expand All @@ -40,14 +40,32 @@ jobs:

- name: Install dependencies
run: |
pip install pylint
pip install pyroma
- name: Check package metadata
run: |
pyroma --min=10 .
yamllint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install yamllint
- name: Run linting
continue-on-error: true
run: |
pylint **/*.py
yamllint .
pyroma:
pylint:
runs-on: ubuntu-latest

steps:
Expand All @@ -60,11 +78,12 @@ jobs:

- name: Install dependencies
run: |
pip install pyroma
pip install pylint
- name: Check package metadata
- name: Run linting
continue-on-error: true
run: |
pyroma --min=10 .
pylint **/*.py
mypy:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Testing

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- master
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ ci:
autoupdate_schedule: quarterly

repos:
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.31.0
hooks:
- id: yapf
name: Format code
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.31.0
hooks:
- id: yapf
name: Format code
9 changes: 9 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: default

rules:
line-length: disable
document-start: disable
truthy:
level: error
braces:
max-spaces-inside: 1
1 change: 0 additions & 1 deletion conda/pyg/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ requirements:
- pip
- python {{ environ.get('PYTHON_VERSION') }}

run:
run:
- python {{ environ.get('PYTHON_VERSION') }}
- {{ environ.get('CONDA_PYTORCH_CONSTRAINT') }}
Expand Down
Loading

0 comments on commit 0805d05

Please sign in to comment.