Skip to content

Commit b97cfa7

Browse files
authored
[Enhancement] Revise pre-commit-hooks (open-mmlab#1315)
1 parent 59fa6f6 commit b97cfa7

23 files changed

+28
-0
lines changed

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,9 @@ repos:
4949
language: python
5050
files: ^configs/.*\.md$
5151
require_serial: true
52+
- repo: https://github.com/open-mmlab/pre-commit-hooks
53+
rev: v0.2.0 # Use the rev to fix revision
54+
hooks:
55+
- id: check-algo-readme
56+
- id: check-copyright
57+
args: ["mmseg", "tools", "tests", "demo"] # the dir_to_check with expected directory to check

demo/video_demo.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
from argparse import ArgumentParser
23

34
import cv2

mmseg/datasets/coco_stuff.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
from .builder import DATASETS
23
from .custom import CustomDataset
34

mmseg/datasets/dark_zurich.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
from .builder import DATASETS
23
from .cityscapes import CityscapesDataset
34

mmseg/datasets/isaid.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import os.path as osp
23

34
import mmcv

mmseg/datasets/night_driving.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
from .builder import DATASETS
23
from .cityscapes import CityscapesDataset
34

mmseg/models/backbones/icnet.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import torch
23
import torch.nn as nn
34
from mmcv.cnn import ConvModule

mmseg/models/backbones/twins.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import math
23
import warnings
34

mmseg/models/decode_heads/dpt_head.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import math
23

34
import torch

mmseg/models/decode_heads/isa_head.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import math
23

34
import torch

mmseg/models/necks/ic_neck.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import torch.nn.functional as F
23
from mmcv.cnn import ConvModule
34
from mmcv.runner import BaseModule

mmseg/models/utils/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
from .embed import PatchEmbed
23
from .inverted_residual import InvertedResidual, InvertedResidualV3
34
from .make_divisible import make_divisible

tests/test_apis/test_single_gpu.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import shutil
23
from unittest.mock import MagicMock
34

tests/test_models/test_backbones/test_swin.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import pytest
23
import torch
34

tests/test_models/test_backbones/test_twins.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import pytest
23
import torch
34

tests/test_models/test_heads/test_dpt_head.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import pytest
23
import torch
34

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.

tools/browse_dataset.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import argparse
23
import os
34
import warnings

tools/convert_datasets/coco_stuff10k.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import argparse
23
import os.path as osp
34
import shutil

tools/convert_datasets/coco_stuff164k.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import argparse
23
import os.path as osp
34
import shutil

tools/convert_datasets/isaid.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import argparse
23
import glob
34
import os

tools/model_converters/vitjax2mmseg.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
import argparse
23
import os.path as osp
34

tools/torchserve/test_torchserve.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) OpenMMLab. All rights reserved.
12
from argparse import ArgumentParser
23
from io import BytesIO
34

0 commit comments

Comments
 (0)