Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Add pre-commit and reformat code (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhijian Liu authored Sep 26, 2021
1 parent 828fe85 commit aac73c0
Show file tree
Hide file tree
Showing 71 changed files with 894 additions and 1,302 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pre-commit

on:
pull_request:
push:
branches: [master]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get update
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docs/build
.vscode/
.idea/
__pycache__/
__pycache__/
66 changes: 66 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
name: (Common) Remove trailing whitespaces
- id: mixed-line-ending
name: (Common) Fix mixed line ending
args: ['--fix=lf']
- id: end-of-file-fixer
name: (Common) Remove extra EOF newlines
- id: check-merge-conflict
name: (Common) Check for merge conflicts
- id: requirements-txt-fixer
name: (Common) Sort "requirements.txt"
- id: fix-encoding-pragma
name: (Python) Remove encoding pragmas
args: ['--remove']
- id: double-quote-string-fixer
name: (Python) Fix double-quoted strings
- id: debug-statements
name: (Python) Check for debugger imports
- id: check-json
name: (JSON) Check syntax
- id: check-yaml
name: (YAML) Check syntax
- id: check-toml
name: (TOML) Check syntax
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.7
hooks:
- id: mdformat
name: (Markdown) Format with mdformat
- repo: https://github.com/asottile/pyupgrade
rev: v2.19.4
hooks:
- id: pyupgrade
name: (Python) Update syntax for newer versions
args: ['--py36-plus']
- repo: https://github.com/google/yapf
rev: v0.31.0
hooks:
- id: yapf
name: (Python) Format with yapf
- repo: https://github.com/pycqa/isort
rev: 5.8.0
hooks:
- id: isort
name: (Python) Sort imports with isort (torchpack)
exclude: examples/
- id: isort
name: (Python) Sort imports with isort (examples)
files: ^examples/
args: [--sp, examples/setup.cfg]
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
name: (Python) Check with flake8
additional_dependencies: [flake8-bugbear, flake8-comprehensions, flake8-docstrings, flake8-executable, flake8-quotes]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.902
hooks:
- id: mypy
name: (Python) Check with mypy
additional_dependencies: [tokenize-rt, types-pyyaml, types-toml]
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Torchpack

Torchpack is a neural network training interface based on PyTorch, with a focus on flexibility.

## Installation
Expand All @@ -9,8 +10,8 @@ pip install torchpack

## Acknowlegements

* [Tensorpack](https://github.com/tensorpack/tensorpack)
* [Detectron2](https://github.com/facebookresearch/detectron2)
* [Jacinle](https://github.com/vacancy/Jacinle)
* [PyTorch Lightning](https://github.com/PyTorchLightning/pytorch-lightning)
* [MMCV](https://github.com/open-mmlab/mmcv)
- [Tensorpack](https://github.com/tensorpack/tensorpack)
- [Detectron2](https://github.com/facebookresearch/detectron2)
- [Jacinle](https://github.com/vacancy/Jacinle)
- [PyTorch Lightning](https://github.com/PyTorchLightning/pytorch-lightning)
- [MMCV](https://github.com/open-mmlab/mmcv)
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

69 changes: 0 additions & 69 deletions docs/source/conf.py

This file was deleted.

46 changes: 0 additions & 46 deletions docs/source/index.rst

This file was deleted.

85 changes: 0 additions & 85 deletions docs/source/torchpack.callbacks.rst

This file was deleted.

Loading

0 comments on commit aac73c0

Please sign in to comment.