Skip to content

Commit

Permalink
[Enhancement] Revise pre-commit-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
MeowZheng committed Feb 23, 2022
1 parent 8cf333c commit 0244a74
Show file tree
Hide file tree
Showing 23 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ repos:
language: python
files: ^configs/.*\.md$
require_serial: true
- repo: https://github.com/open-mmlab/pre-commit-hooks
rev: v0.2.0 # Use the rev to fix revision
hooks:
- id: check-algo-readme
- id: check-copyright
args: ["mmseg", "tools", "tests", "demo"] # the dir_to_check with expected directory to check
1 change: 1 addition & 0 deletions demo/video_demo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from argparse import ArgumentParser

import cv2
Expand Down
1 change: 1 addition & 0 deletions mmseg/datasets/coco_stuff.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .builder import DATASETS
from .custom import CustomDataset

Expand Down
1 change: 1 addition & 0 deletions mmseg/datasets/dark_zurich.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .builder import DATASETS
from .cityscapes import CityscapesDataset

Expand Down
1 change: 1 addition & 0 deletions mmseg/datasets/isaid.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp

import mmcv
Expand Down
1 change: 1 addition & 0 deletions mmseg/datasets/night_driving.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .builder import DATASETS
from .cityscapes import CityscapesDataset

Expand Down
1 change: 1 addition & 0 deletions mmseg/models/backbones/icnet.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule
Expand Down
1 change: 1 addition & 0 deletions mmseg/models/backbones/twins.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import math
import warnings

Expand Down
1 change: 1 addition & 0 deletions mmseg/models/decode_heads/dpt_head.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import math

import torch
Expand Down
1 change: 1 addition & 0 deletions mmseg/models/decode_heads/isa_head.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import math

import torch
Expand Down
1 change: 1 addition & 0 deletions mmseg/models/necks/ic_neck.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
Expand Down
1 change: 1 addition & 0 deletions mmseg/models/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .embed import PatchEmbed
from .inverted_residual import InvertedResidual, InvertedResidualV3
from .make_divisible import make_divisible
Expand Down
1 change: 1 addition & 0 deletions tests/test_apis/test_single_gpu.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import shutil
from unittest.mock import MagicMock

Expand Down
1 change: 1 addition & 0 deletions tests/test_models/test_backbones/test_swin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch

Expand Down
1 change: 1 addition & 0 deletions tests/test_models/test_backbones/test_twins.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch

Expand Down
1 change: 1 addition & 0 deletions tests/test_models/test_heads/test_dpt_head.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch

Expand Down
1 change: 1 addition & 0 deletions tests/test_models/test_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Copyright (c) OpenMMLab. All rights reserved.
1 change: 1 addition & 0 deletions tools/browse_dataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os
import warnings
Expand Down
1 change: 1 addition & 0 deletions tools/convert_datasets/coco_stuff10k.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os.path as osp
import shutil
Expand Down
1 change: 1 addition & 0 deletions tools/convert_datasets/coco_stuff164k.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os.path as osp
import shutil
Expand Down
1 change: 1 addition & 0 deletions tools/convert_datasets/isaid.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import glob
import os
Expand Down
1 change: 1 addition & 0 deletions tools/model_converters/vitjax2mmseg.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os.path as osp

Expand Down
1 change: 1 addition & 0 deletions tools/torchserve/test_torchserve.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from argparse import ArgumentParser
from io import BytesIO

Expand Down

0 comments on commit 0244a74

Please sign in to comment.