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

[Refactor] Use mdformat instead of markdownlint to format markdown. #844

Merged
merged 4 commits into from
Jun 2, 2022
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
13 changes: 8 additions & 5 deletions .github/ISSUE_TEMPLATE/----.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,30 @@ about: 遇到问题并寻求帮助
title: ''
labels: help wanted
assignees: ''

---

推荐使用英语模板 General question,以便你的问题帮助更多人。

### 首先确认以下内容

- 我已经查询了相关的 issue,但没有找到需要的帮助。
- 我已经阅读了相关文档,但仍不知道如何解决。

### 描述你遇到的问题

[填写这里]
\[填写这里\]

### 相关信息

1. `pip list | grep "mmcv\|mmcls\|^torch"` 命令的输出
[填写这里]
\[填写这里\]
2. 如果你修改了,或者使用了新的配置文件,请在这里写明

```python
[填写这里]
```

3. 如果你是在训练过程中遇到的问题,请填写完整的训练日志和报错信息
[填写这里]
\[填写这里\]
4. 如果你对 `mmcls` 文件夹下的代码做了其他相关的修改,请在这里写明
[填写这里]
\[填写这里\]
14 changes: 8 additions & 6 deletions .github/ISSUE_TEMPLATE/---.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
---
name: 新功能
about: 为项目提一个建议
title: "[Feature]"
title: '[Feature]'
labels: enhancement
assignees: ''

---

推荐使用英语模板 Feature request,以便你的问题帮助更多人。

### 描述这个功能

[填写这里]
\[填写这里\]

### 动机

请简要说明以下为什么需要添加这个新功能
例 1. 现在进行 xxx 的时候不方便
例 2. 最近的论文中提出了有一个很有帮助的 xx

[填写这里]
\[填写这里\]

### 相关资源

是否有相关的官方实现或者第三方实现?这些会很有参考意义。

[填写这里]
\[填写这里\]

### 其他相关信息

其他和这个功能相关的信息或者截图,请放在这里。
另外如果你愿意参与实现这个功能并提交 PR,请在这里说明,我们将非常欢迎。

[填写这里]
\[填写这里\]
19 changes: 12 additions & 7 deletions .github/ISSUE_TEMPLATE/---bug.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
---
name: 报告 Bug
about: 报告问题以帮助我们提升
title: "[Bug]"
title: '[Bug]'
labels: bug
assignees: ''

---

推荐使用英语模板 Bug report,以便你的问题帮助更多人。

### 描述 bug

简单地描述一下遇到了什么 bug

[填写这里]
\[填写这里\]

### 复现流程

在命令行中执行的详细操作

```shell
[填写这里]
```

### 相关信息

1. `pip list | grep "mmcv\|mmcls\|^torch"` 命令的输出
[填写这里]
\[填写这里\]
2. 如果你修改了,或者使用了新的配置文件,请在这里写明

```python
[填写这里]
```

3. 如果你是在训练过程中遇到的问题,请填写完整的训练日志和报错信息
[填写这里]
\[填写这里\]
4. 如果你对 `mmcls` 文件夹下的代码做了其他相关的修改,请在这里写明
[填写这里]
\[填写这里\]

### 附加内容

任何其他有关该 bug 的信息、截图等

[填写这里]
\[填写这里\]
19 changes: 12 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
---
name: Bug report
about: Create a report to help us improve
title: "[Bug]"
title: '[Bug]'
labels: bug
assignees: ''

---

### Describe the bug

A clear and concise description of what the bug is.

[here]
\[here\]

### To Reproduce

The command you executed.

```shell
[here]
```

### Post related information

1. The output of `pip list | grep "mmcv\|mmcls\|^torch"`
[here]
\[here\]
2. Your config file if you modified it or created a new one.

```python
[here]
```

3. Your train log file if you meet the problem during training.
[here]
\[here\]
4. Other code you modified in the `mmcls` folder.
[here]
\[here\]

### Additional context

Add any other context about the problem here.

[here]
\[here\]
18 changes: 10 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature]"
title: '[Feature]'
labels: enhancement
assignees: ''

---

### Describe the feature

[here]
\[here\]

### Motivation

A clear and concise description of the motivation of the feature.
Ex1. It is inconvenient when [....].
Ex2. There is a recent paper [....], which is very helpful for [....].
Ex1. It is inconvenient when \[....\].
Ex2. There is a recent paper \[....\], which is very helpful for \[....\].

[here]
\[here\]

### Related resources

If there is an official code release or third-party implementation, please also provide the information here, which would be very helpful.

[here]
\[here\]

### Additional context

Add any other context or screenshots about the feature request here.
If you would like to implement the feature and create a PR, please leave a comment here and that would be much appreciated.

[here]
\[here\]
13 changes: 8 additions & 5 deletions .github/ISSUE_TEMPLATE/general-questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@ about: 'Ask general questions to get help '
title: ''
labels: help wanted
assignees: ''

---

### Checklist

- I have searched related issues but cannot get the expected help.
- I have read related documents and don't know what to do.

### Describe the question you meet

[here]
\[here\]

### Post related information

1. The output of `pip list | grep "mmcv\|mmcls\|^torch"`
[here]
\[here\]
2. Your config file if you modified it or created a new one.

```python
[here]
```

3. Your train log file if you meet the problem during training.
[here]
\[here\]
4. Other code you modified in the `mmcls` folder.
[here]
\[here\]
15 changes: 9 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ repos:
args: ["--remove"]
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0
hooks:
- id: markdownlint
args: ["-r", "~MD002,~MD013,~MD029,~MD033,~MD034",
"-t", "allow_different_nesting"]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.9
hooks:
- id: mdformat
args: ["--number", "--table-width", "200"]
additional_dependencies:
- mdformat-openmmlab
- mdformat_frontmatter
- linkify-it-py
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
Expand Down
61 changes: 61 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Contributing to OpenMMLab

All kinds of contributions are welcome, including but not limited to the following.

- Fix typo or bugs
- Add documentation or translate the documentation into other languages
- Add new features and components

## Workflow

1. fork and pull the latest OpenMMLab repository (MMClassification)
2. checkout a new branch (do not use master branch for PRs)
3. commit your changes
4. create a PR

```{note}
If you plan to add some new features that involve large changes, it is encouraged to open an issue for discussion first.
```

## Code style

### Python

We adopt [PEP8](https://www.python.org/dev/peps/pep-0008/) as the preferred code style.

We use the following tools for linting and formatting:

- [flake8](https://github.com/PyCQA/flake8): A wrapper around some linter tools.
- [isort](https://github.com/timothycrosley/isort): A Python utility to sort imports.
- [yapf](https://github.com/google/yapf): A formatter for Python files.
- [codespell](https://github.com/codespell-project/codespell): A Python utility to fix common misspellings in text files.
- [mdformat](https://github.com/executablebooks/mdformat): Mdformat is an opinionated Markdown formatter that can be used to enforce a consistent style in Markdown files.
- [docformatter](https://github.com/myint/docformatter): A formatter to format docstring.

Style configurations can be found in [setup.cfg](./setup.cfg).

We use [pre-commit hook](https://pre-commit.com/) that checks and formats for `flake8`, `yapf`, `isort`, `trailing whitespaces`, `markdown files`,
fixes `end-of-files`, `double-quoted-strings`, `python-encoding-pragma`, `mixed-line-ending`, sorts `requirments.txt` automatically on every commit.
The config for a pre-commit hook is stored in [.pre-commit-config](https://github.com/open-mmlab/mmclassification/blob/master/.pre-commit-config.yaml).

After you clone the repository, you will need to install initialize pre-commit hook.

```shell
pip install -U pre-commit
```

From the repository folder

```shell
pre-commit install
```

After this on every commit check code linters and formatter will be enforced.

```{important}
Before you create a PR, make sure that your code lints and is formatted by yapf.
```

### C++ and CUDA

We follow the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">

<img src="resources/mmcls-logo.png" width="600"/>
<img src="resources/mmcls-logo.png" width="600"/>
<div>&nbsp;</div>
<div align="center">
<b><font size="5">OpenMMLab website</font></b>
Expand All @@ -19,20 +19,19 @@
</div>
<div>&nbsp;</div>

[![PyPI](https://img.shields.io/pypi/v/mmcls)](https://pypi.org/project/mmcls)
[![Docs](https://img.shields.io/badge/docs-latest-blue)](https://mmclassification.readthedocs.io/en/latest/)
[![Build Status](https://github.com/open-mmlab/mmclassification/workflows/build/badge.svg)](https://github.com/open-mmlab/mmclassification/actions)
[![codecov](https://codecov.io/gh/open-mmlab/mmclassification/branch/master/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmclassification)
[![license](https://img.shields.io/github/license/open-mmlab/mmclassification.svg)](https://github.com/open-mmlab/mmclassification/blob/master/LICENSE)
[![open issues](https://isitmaintained.com/badge/open/open-mmlab/mmclassification.svg)](https://github.com/open-mmlab/mmclassification/issues)
[![issue resolution](https://isitmaintained.com/badge/resolution/open-mmlab/mmclassification.svg)](https://github.com/open-mmlab/mmclassification/issues)

[![PyPI](https://img.shields.io/pypi/v/mmcls)](https://pypi.org/project/mmcls)
[![Docs](https://img.shields.io/badge/docs-latest-blue)](https://mmclassification.readthedocs.io/en/latest/)
[![Build Status](https://github.com/open-mmlab/mmclassification/workflows/build/badge.svg)](https://github.com/open-mmlab/mmclassification/actions)
[![codecov](https://codecov.io/gh/open-mmlab/mmclassification/branch/master/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmclassification)
[![license](https://img.shields.io/github/license/open-mmlab/mmclassification.svg)](https://github.com/open-mmlab/mmclassification/blob/master/LICENSE)
[![open issues](https://isitmaintained.com/badge/open/open-mmlab/mmclassification.svg)](https://github.com/open-mmlab/mmclassification/issues)
[![issue resolution](https://isitmaintained.com/badge/resolution/open-mmlab/mmclassification.svg)](https://github.com/open-mmlab/mmclassification/issues)

[📘 Documentation](https://mmclassification.readthedocs.io/en/latest/) |
[🛠️ Installation](https://mmclassification.readthedocs.io/en/latest/install.html) |
[👀 Model Zoo](https://mmclassification.readthedocs.io/en/latest/model_zoo.html) |
[🆕 Update News](https://mmclassification.readthedocs.io/en/latest/changelog.html) |
[🤔 Reporting Issues](https://github.com/open-mmlab/mmclassification/issues/new/choose)
[📘 Documentation](https://mmclassification.readthedocs.io/en/latest/) |
[🛠️ Installation](https://mmclassification.readthedocs.io/en/latest/install.html) |
[👀 Model Zoo](https://mmclassification.readthedocs.io/en/latest/model_zoo.html) |
[🆕 Update News](https://mmclassification.readthedocs.io/en/latest/changelog.html) |
[🤔 Reporting Issues](https://github.com/open-mmlab/mmclassification/issues/new/choose)

</div>

Expand Down Expand Up @@ -61,13 +60,15 @@ The master branch works with **PyTorch 1.5+**.

v0.23.0 was released in 1/5/2022.
Highlights of the new version:

- Support **DenseNet**, **VAN** and **PoolFormer**, and provide pre-trained models.
- Support training on IPU.
- New style API docs, welcome [view it](https://mmclassification.readthedocs.io/en/master/api/models.html).

v0.22.0 was released in 30/3/2022.

Highlights of the new version:

- Support a series of **CSP Network**, such as CSP-ResNet, CSP-ResNeXt and CSP-DarkNet.
- A new `CustomDataset` class to help you **build dataset of yourself**!
- Support new backbones - **ConvMixer**, **RepMLP** and new dataset - **CUB dataset**.
Expand Down
Loading