[Enhance] Add a new pre-commit-hook to automatically add a copyright. (#710)

pull/650/head
Ma Zerun 2022-02-25 11:48:07 +08:00 committed by GitHub
parent 8374c05b0a
commit 1b5712a551
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 0 deletions

View File

@ -40,6 +40,11 @@ repos:
hooks:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
- repo: https://github.com/open-mmlab/pre-commit-hooks
rev: v0.2.0
hooks:
- id: check-copyright
args: ["mmcls", "tests", "demo", "tools"]
# - repo: local
# hooks:
# - id: clang-format

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
from pathlib import Path

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
from pathlib import Path

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
from collections import OrderedDict
from pathlib import Path

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from argparse import ArgumentParser
import numpy as np

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os.path as osp
import re

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import itertools
import os