Add copyright pre-commit-hook (#1742)

* first commit

* Add copyright pre-commit-hook
pull/1545/head
Zaida Zhou 2022-02-24 09:24:25 +08:00 committed by GitHub
parent 0a8e67f753
commit 6e9ce18323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
119 changed files with 124 additions and 0 deletions

View File

@ -40,6 +40,12 @@ repos:
hooks:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
- repo: https://github.com/open-mmlab/pre-commit-hooks
rev: v0.2.0 # Use the ref you want to point at
hooks:
- id: check-copyright
args: ["mmcv", "tests", "--excludes", "mmcv/ops"]
# - repo: local
# hooks:
# - id: clang-format

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .builder import RUNNER_BUILDERS, RUNNERS

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
# The 1.6 release of PyTorch switched torch.save to use a new zipfile-based
# file format. It will cause RuntimeError when a checkpoint was saved in
# torch >= 1.6.0 but loaded in torch < 1.7.0.

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = [1, 2]
item2 = {'a': 0}
item3 = True

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = [1, 2]
item2 = {'a': 0}
item3 = True

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = [1, 2]
item2 = {'a': 0}
item3 = True

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from mmcv import Config # isort:skip
cfg = Config.fromfile('./tests/data/config/a.py')

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './base.py'
item1 = [2, 3]
item2 = {'a': 1}

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './base.py'
item1 = {'a': 0, '_delete_': True}
item2 = {'b': 0}

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './expected.py'
_deprecation_ = dict(

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './deprecated.py'

View File

@ -1,2 +1,3 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './base.py'
item3 = {'a': 1}

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = 'expected'

View File

@ -1,2 +1,3 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './d.py'
item4 = 'test_recursive_bases'

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
filename = 'reserved.py'

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = '{{fileBasename}}'
item2 = '{{ fileDirname}}'
item3 = 'abc_{{ fileBasenameNoExtension }}'

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = [1, 2]
item2 = {'a': 0}
item3 = True

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = './i_base.py'
item_cfg = {'b': 2}
item6 = {'cfg': item_cfg}

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = ['./l1.py', './l2.yaml', './l3.json', './l4.py']
item3 = False
item4 = 'test'

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
item1 = [1, 2]

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
item5 = dict(a=0, b=1)
item6 = [dict(a=0), dict(b=1)]
item7 = dict(a=[0, 1, 2], b=dict(c=[3.1, 4.2, 5.3]))

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = ['./l1.py', './l2.yaml', './l3.json', 'a.py']
item3 = False
item4 = 'test'

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
test_item1 = [1, 2]
bool_item2 = True
str_item3 = 'test'

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
custom_imports = dict(imports=['r'], allow_failed_imports=False)

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os
os.environ["TEST_VALUE"] = 'test'

View File

@ -1 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
item = [{'a': 0}, {'b': 0, 'c': 0}]

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = ['./l1.py', './l2.yaml', './l3.json', './l4.py']
item3 = False
item4 = 'test'

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = ['./t.py']
base = '_base_.item8'
item11 = {{ _base_.item8 }}

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = ['./u.py']
item21 = {{ _base_.item11 }}
item22 = item21

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
#!/usr/bin/env python
import argparse

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmcv.cnn.bricks import Conv2dAdaptivePadding

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import warnings
from unittest.mock import patch

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmcv.cnn.bricks import GeneralizedAttention

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch.nn.functional import relu6

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch.nn as nn
import mmcv

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
import torch.nn as nn

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmcv.cnn.bricks import Scale

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn.functional as F

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from unittest.mock import patch
import pytest

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn.functional as F

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch.autograd import gradcheck

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
"""
CommandLine:
pytest tests/test_corner_pool.py

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
"""
CommandLine:
pytest tests/test_merge_cells.py

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os
import warnings
from functools import partial

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from torch.autograd import gradcheck

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from torch import nn

View File

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

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import os
from functools import partial
from typing import Callable

View File

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

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More