From 35c8f4ce479e7dc7aab59e03bf00cba2d777ddb0 Mon Sep 17 00:00:00 2001 From: Saurav Maheshkar Date: Sun, 5 Mar 2023 12:29:34 +0000 Subject: [PATCH] [refactor] restructure configuration files (#2977) * gh: move CONTRIBUTING to .github * chore: move isort config to pyproject * chore: move pytest config to pyproject * chore: move yapf config to pyproject * chore: move clang-format config to pre-commit --- .clang-format | 1 - CONTRIBUTING.md => .github/CONTRIBUTING.md | 2 +- .isort.cfg | 5 ----- .pre-commit-config.yaml | 3 ++- .style.yapf | 5 ----- pyproject.toml | 19 +++++++++++++++++++ pytest.ini | 6 ------ 7 files changed, 22 insertions(+), 19 deletions(-) delete mode 100644 .clang-format rename CONTRIBUTING.md => .github/CONTRIBUTING.md (99%) delete mode 100644 .isort.cfg delete mode 100644 .style.yapf create mode 100644 pyproject.toml delete mode 100644 pytest.ini diff --git a/.clang-format b/.clang-format deleted file mode 100644 index f6cb8ad93..000000000 --- a/.clang-format +++ /dev/null @@ -1 +0,0 @@ -BasedOnStyle: Google diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 99% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md index 00abcf650..915c43174 100644 --- a/CONTRIBUTING.md +++ b/.github/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. \ No newline at end of file +In case of code conflict, you should rebase your branch and resolve the conflicts manually. diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index 090aa28e3..000000000 --- a/.isort.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[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 725d26637..b98edb6c9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,13 +11,14 @@ repos: hooks: - id: yapf name: yapf formatter - args: ['--style=.style.yapf', '--parallel', '--in-place'] + args: ['--style=pyproject.toml', '--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 deleted file mode 100644 index 05be0dc6a..000000000 --- a/.style.yapf +++ /dev/null @@ -1,5 +0,0 @@ -[style] -based_on_style = google -spaces_before_comment = 4 -split_before_logical_operator = true -column_limit = 120 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..5d918a578 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,19 @@ +[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 deleted file mode 100644 index ac31ace4b..000000000 --- a/pytest.ini +++ /dev/null @@ -1,6 +0,0 @@ -[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