Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit and enable pre-commit hooks to check code before commtting #68

Merged
merged 2 commits into from
Apr 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ body:
- type: textarea
id: system-info
attributes:
label: System Info
label: 1. System Info
description: Please share information about your operating environment with us.
placeholder: PyPOTS version, Python version, platform and your OS version, and versions of other libraries existing in the error message...
validations:
Expand All @@ -15,7 +15,7 @@ body:
- type: checkboxes
id: information-scripts-examples
attributes:
label: Information
label: 2. Information
description: 'The problem happens when running:'
options:
- label: "The official example scripts"
Expand All @@ -26,7 +26,7 @@ body:
validations:
required: true
attributes:
label: Reproduction
label: 3. Reproduction
description: |
Please provide a code sample that reproduces the problem you ran into. It can be a Colab link or just a code snippet.
If you have code snippets, error messages, stack traces please provide them here as well.
Expand All @@ -35,17 +35,18 @@ body:

placeholder: |
Steps to reproduce the behavior:

1.
2.
3.



……


- type: textarea
id: expected-behavior
validations:
required: true
attributes:
label: Expected behavior
label: 4. Expected behavior
description: "A clear and concise description of what error you would expect to happen."

3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
blank_issues_enabled: true
version: 2.1
contact_links:
- name: PyPOTS Community on Slack
url: pypots-dev.slack.com
about: General usage questions and community discussions
about: General usage questions, community discussions, and the development team are here.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: "🙌 Feature Request"
description: Submit a request to add a new feature.
labels: ["new feature"]
labels: ["new feature", "enhancement"]

body:
- type: textarea
id: feature-description-requested
validations:
required: true
attributes:
label: Feature description
label: 1. Feature description
description: |
A clear and concise description of the feature proposal. Please provide a link to the paper and code if they exist.

Expand All @@ -17,7 +17,7 @@ body:
validations:
required: true
attributes:
label: Motivation
label: 2. Motivation
description: |
Please outline the motivation of your proposal. Is your feature request related to a problem? If this is related to another GitHub issue, please link here.

Expand All @@ -26,6 +26,6 @@ body:
validations:
required: true
attributes:
label: Your contribution
label: 3. Your contribution
description: |
Is there any way that you could help, for example, by submitting a PR?
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/model-addition.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: "🤙 New Model Addition"
description: Submit a request to implement a new model.
labels: ["new model"]
labels: ["new model", "enhancement"]

body:
- type: textarea
id: model-description-requested
validations:
required: true
attributes:
label: Model description
label: 1. Model description
description: |
Put all important information relative to the new model, e.g. paper link, citation number, and why you think it is necessary for PyPOTS to include.
Put all important information relative to the new model, e.g. paper link, citation number, and why you think it is necessary for PyPOTS to include.
❗️A rule of thumb is at least one year since publication, 10+ citations, and usefulness.

- type: checkboxes
id: information-tasks
attributes:
label: Check open-source status
label: 2. Check open-source status
description: |
Please note that if the model's open-source implementation is not available, it'll take much more time to finish the implementation, so we are less likely to implement it in `PyPOTS`.
options:
Expand All @@ -25,8 +25,8 @@ body:
- type: textarea
id: additional-info
attributes:
label: Provide useful information for the implementation
label: 3. Provide useful information for the implementation
description: |
Give any and all information you think is helpful to the implementation.
Give any and all information you think is helpful to the implementation.
If there is open-source implementation, please provide information regarding it and the authors.
Please mention the authors by @github-username in case you're aware of their usernames.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/other-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "🤔 Other Kinds of Issues"
description: "Didn't find a proper issue template above? Start here!"
labels: ["question"]

body:
- type: textarea
id: issue-description-requested
validations:
required: true
attributes:
label: Issue description
description: |
A clear and concise description of the issue. Please provide a link to related information and code if they exist.
Besides, please add according labels to the issue on the right side of the page.
13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE/other-questions.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
repos:
# hooks for checking files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml

# hooks for optimizing imports
- repo: https://github.com/PyCQA/autoflake
rev: v2.1.1
hooks:
- id: autoflake
args: [
--check,
--remove-all-unused-imports,
]

# hooks for linting code
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args: [
--max-line-length=120, # refer to setup.cfg
--extend-ignore=E203, # why ignore E203? Refer to https://github.com/PyCQA/pycodestyle/issues/373
]
1 change: 1 addition & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ dependencies:
# dev
- conda-forge::black
- conda-forge::flake8
- conda-forge::pre-commit
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ doc =
dev =
black
flake8
pre-commit
%(full)s
%(test)s
%(doc)s