From 2e427ddf422ad0a450e680ba73354cc12c80bb2e Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Tue, 7 Mar 2023 13:31:23 +0800 Subject: [PATCH] [revert] recover "[refactor] restructure configuration files (#2977)" (#3022) This reverts commit 35c8f4ce479e7dc7aab59e03bf00cba2d777ddb0. --- .clang-format | 1 + .isort.cfg | 5 +++++ .pre-commit-config.yaml | 3 +-- .style.yapf | 5 +++++ .github/CONTRIBUTING.md => CONTRIBUTING.md | 2 +- pyproject.toml | 19 ------------------- pytest.ini | 6 ++++++ 7 files changed, 19 insertions(+), 22 deletions(-) create mode 100644 .clang-format create mode 100644 .isort.cfg create mode 100644 .style.yapf rename .github/CONTRIBUTING.md => CONTRIBUTING.md (99%) delete mode 100644 pyproject.toml create mode 100644 pytest.ini diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..f6cb8ad93 --- /dev/null +++ b/.clang-format @@ -0,0 +1 @@ +BasedOnStyle: Google diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 000000000..090aa28e3 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,5 @@ +[settings] +line_length = 120 +multi_line_output=3 +include_trailing_comma = true +ignore_comments = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b98edb6c9..725d26637 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,14 +11,13 @@ repos: hooks: - id: yapf name: yapf formatter - args: ['--style=pyproject.toml', '--parallel', '--in-place'] + args: ['--style=.style.yapf', '--parallel', '--in-place'] - repo: https://github.com/pre-commit/mirrors-clang-format rev: v13.0.1 hooks: - id: clang-format name: clang formatter - args: [--style, "{BasedOnStyle: Google}"] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 diff --git a/.style.yapf b/.style.yapf new file mode 100644 index 000000000..05be0dc6a --- /dev/null +++ b/.style.yapf @@ -0,0 +1,5 @@ +[style] +based_on_style = google +spaces_before_comment = 4 +split_before_logical_operator = true +column_limit = 120 diff --git a/.github/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 99% rename from .github/CONTRIBUTING.md rename to CONTRIBUTING.md index 915c43174..00abcf650 100644 --- a/.github/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -138,4 +138,4 @@ You can now create a pull request on the GitHub webpage of your repository. The Do write clearly the description of your pull request and [link the pull request to your target issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue). This will automatically close the issue when the pull request is approved. -In case of code conflict, you should rebase your branch and resolve the conflicts manually. +In case of code conflict, you should rebase your branch and resolve the conflicts manually. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 5d918a578..000000000 --- a/pyproject.toml +++ /dev/null @@ -1,19 +0,0 @@ -[tool.isort] -line_length = 120 -multi_line_output = 3 -include_trailing_comma = true -ignore_comments = true - -[tool.yapf] -based_on_style = "google" -spaces_before_comment = 4 -split_before_logical_operator = true -column_limit = 120 - -[tool.pytest.ini_options] -markers = [ - "cpu: tests which can run on CPU", - "gpu: tests which requires a single GPU", - "dist: tests which are run in a multi-GPU or multi-machine environment", - "experiment: tests for experimental features", -] diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 000000000..ac31ace4b --- /dev/null +++ b/pytest.ini @@ -0,0 +1,6 @@ +[pytest] +markers = + cpu: tests which can run on CPU + gpu: tests which requires a single GPU + dist: tests which are run in a multi-GPU or multi-machine environment + experiment: tests for experimental features \ No newline at end of file