xref: /aosp_15_r20/external/pigweed/pw_presubmit/py/BUILD.gn (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2020 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15import("//build_overrides/pigweed.gni")
16
17import("$dir_pw_build/python.gni")
18
19pw_python_package("py") {
20  setup = [
21    "pyproject.toml",
22    "setup.cfg",
23  ]
24  sources = [
25    "pw_presubmit/__init__.py",
26    "pw_presubmit/bazel_checks.py",
27    "pw_presubmit/bazel_parser.py",
28    "pw_presubmit/build.py",
29    "pw_presubmit/cli.py",
30    "pw_presubmit/cpp_checks.py",
31    "pw_presubmit/format/__init__.py",
32    "pw_presubmit/format/bazel.py",
33    "pw_presubmit/format/core.py",
34    "pw_presubmit/format/cpp.py",
35    "pw_presubmit/format/gn.py",
36    "pw_presubmit/format/python.py",
37    "pw_presubmit/format/test_data/__init__.py",
38    "pw_presubmit/format_code.py",
39    "pw_presubmit/git_repo.py",
40    "pw_presubmit/gitmodules.py",
41    "pw_presubmit/inclusive_language.py",
42    "pw_presubmit/install_hook.py",
43    "pw_presubmit/javascript_checks.py",
44    "pw_presubmit/json_check.py",
45    "pw_presubmit/keep_sorted.py",
46    "pw_presubmit/module_owners.py",
47    "pw_presubmit/ninja_parser.py",
48    "pw_presubmit/npm_presubmit.py",
49    "pw_presubmit/owners_checks.py",
50    "pw_presubmit/pigweed_presubmit.py",
51    "pw_presubmit/presubmit.py",
52    "pw_presubmit/presubmit_context.py",
53    "pw_presubmit/python_checks.py",
54    "pw_presubmit/repo.py",
55    "pw_presubmit/rst_format.py",
56    "pw_presubmit/shell_checks.py",
57    "pw_presubmit/source_in_build.py",
58    "pw_presubmit/todo_check.py",
59    "pw_presubmit/tools.py",
60  ]
61  inputs = [
62    "pw_presubmit/format/test_data/bazel_test_data.bazel",
63    "pw_presubmit/format/test_data/bazel_test_data_golden.bazel",
64    "pw_presubmit/format/test_data/clang_format_config",
65    "pw_presubmit/format/test_data/cpp_test_data.cc",
66    "pw_presubmit/format/test_data/cpp_test_data_golden.cc",
67    "pw_presubmit/format/test_data/gn_test_data.gn",
68    "pw_presubmit/format/test_data/gn_test_data_golden.gn",
69    "pw_presubmit/format/test_data/malformed_file.txt",
70    "pw_presubmit/format/test_data/python_test_data.py",
71    "pw_presubmit/format/test_data/python_test_data_golden.py",
72  ]
73  tests = [
74    "bazel_checks_test.py",
75    "bazel_parser_test.py",
76    "bazel_format_test.py",
77    "context_test.py",
78    "cpp_checks_test.py",
79    "cpp_format_test.py",
80    "format_testing_utils.py",
81    "format_core_test.py",
82    "gitmodules_test.py",
83    "gn_format_test.py",
84    "inclusive_language_test.py",
85    "keep_sorted_test.py",
86    "ninja_parser_test.py",
87    "presubmit_test.py",
88    "python_format_test.py",
89    "owners_checks_test.py",
90    "todo_check_test.py",
91    "tools_test.py",
92  ]
93
94  python_deps = [
95    "$dir_pw_cli/py",
96    "$dir_pw_env_setup/py",
97    "$dir_pw_package/py",
98  ]
99  pylintrc = "$dir_pigweed/.pylintrc"
100  mypy_ini = "$dir_pigweed/.mypy.ini"
101  ruff_toml = "$dir_pigweed/.ruff.toml"
102}
103