pw_ide: Scaffold new module

Change-Id: I9581eab3b41606dbd5d08789ccd3727b1edf631b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/110251
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Chad Norvell <chadnorvell@google.com>
diff --git a/PIGWEED_MODULES b/PIGWEED_MODULES
index 68e65fe..aa337b8 100644
--- a/PIGWEED_MODULES
+++ b/PIGWEED_MODULES
@@ -44,6 +44,7 @@
 pw_hex_dump
 pw_i2c
 pw_i2c_mcuxpresso
+pw_ide
 pw_interrupt
 pw_interrupt_cortex_m
 pw_interrupt_zephyr
diff --git a/pw_build/generated_pigweed_modules_lists.gni b/pw_build/generated_pigweed_modules_lists.gni
index 3c30164..ac997ae 100644
--- a/pw_build/generated_pigweed_modules_lists.gni
+++ b/pw_build/generated_pigweed_modules_lists.gni
@@ -75,6 +75,7 @@
   dir_pw_hex_dump = get_path_info("../pw_hex_dump", "abspath")
   dir_pw_i2c = get_path_info("../pw_i2c", "abspath")
   dir_pw_i2c_mcuxpresso = get_path_info("../pw_i2c_mcuxpresso", "abspath")
+  dir_pw_ide = get_path_info("../pw_ide", "abspath")
   dir_pw_interrupt = get_path_info("../pw_interrupt", "abspath")
   dir_pw_interrupt_cortex_m =
       get_path_info("../pw_interrupt_cortex_m", "abspath")
@@ -213,6 +214,7 @@
     dir_pw_hex_dump,
     dir_pw_i2c,
     dir_pw_i2c_mcuxpresso,
+    dir_pw_ide,
     dir_pw_interrupt,
     dir_pw_interrupt_cortex_m,
     dir_pw_interrupt_zephyr,
@@ -341,6 +343,7 @@
     "$dir_pw_hex_dump:tests",
     "$dir_pw_i2c:tests",
     "$dir_pw_i2c_mcuxpresso:tests",
+    "$dir_pw_ide:tests",
     "$dir_pw_interrupt:tests",
     "$dir_pw_interrupt_cortex_m:tests",
     "$dir_pw_interrupt_zephyr:tests",
@@ -469,6 +472,7 @@
     "$dir_pw_hex_dump:docs",
     "$dir_pw_i2c:docs",
     "$dir_pw_i2c_mcuxpresso:docs",
+    "$dir_pw_ide:docs",
     "$dir_pw_interrupt:docs",
     "$dir_pw_interrupt_cortex_m:docs",
     "$dir_pw_interrupt_zephyr:docs",
diff --git a/pw_cli/docs.rst b/pw_cli/docs.rst
index 3b26d74..b6dc32e 100644
--- a/pw_cli/docs.rst
+++ b/pw_cli/docs.rst
@@ -16,6 +16,7 @@
   doctor   Check that the environment is set up correctly for Pigweed.
   format   Check and fix formatting for source files.
   help     Display detailed information about pw commands.
+  ide      Configure editors and IDEs to work best with Pigweed.
   logdemo  Show how logs look at various levels.
   module   Utilities for managing modules.
   test     Run Pigweed unit tests built using GN.
diff --git a/pw_env_setup/BUILD.gn b/pw_env_setup/BUILD.gn
index 8a1950a..f7c2969 100644
--- a/pw_env_setup/BUILD.gn
+++ b/pw_env_setup/BUILD.gn
@@ -42,6 +42,7 @@
     "$dir_pw_doctor/py",
     "$dir_pw_env_setup/py",
     "$dir_pw_hdlc/py",
+    "$dir_pw_ide/py",
     "$dir_pw_log:protos.python",
     "$dir_pw_log_tokenized/py",
     "$dir_pw_metric/py",
diff --git a/pw_ide/BUILD.gn b/pw_ide/BUILD.gn
new file mode 100644
index 0000000..ab4a0d8
--- /dev/null
+++ b/pw_ide/BUILD.gn
@@ -0,0 +1,25 @@
+# Copyright 2022 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+import("//build_overrides/pigweed.gni")
+
+import("$dir_pw_docgen/docs.gni")
+import("$dir_pw_unit_test/test.gni")
+
+pw_doc_group("docs") {
+  sources = [ "docs.rst" ]
+}
+
+pw_test_group("tests") {
+}
diff --git a/pw_ide/OWNERS b/pw_ide/OWNERS
new file mode 100644
index 0000000..c5ffd1d
--- /dev/null
+++ b/pw_ide/OWNERS
@@ -0,0 +1,2 @@
+chadnorvell@google.com
+tonymd@google.com
diff --git a/pw_ide/README.md b/pw_ide/README.md
new file mode 100644
index 0000000..42d1450
--- /dev/null
+++ b/pw_ide/README.md
@@ -0,0 +1,2 @@
+Tools for Pigweed editor and IDE support.
+[Learn more here.](https://pigweed.dev/pw_ide)
diff --git a/pw_ide/docs.rst b/pw_ide/docs.rst
new file mode 100644
index 0000000..05771e1
--- /dev/null
+++ b/pw_ide/docs.rst
@@ -0,0 +1,7 @@
+.. _module-pw_ide:
+
+------
+pw_ide
+------
+This module provides tools for supporting code editor and IDE features for
+Pigweed projects.
diff --git a/pw_ide/py/BUILD.gn b/pw_ide/py/BUILD.gn
new file mode 100644
index 0000000..0a68e09
--- /dev/null
+++ b/pw_ide/py/BUILD.gn
@@ -0,0 +1,32 @@
+# Copyright 2022 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+import("//build_overrides/pigweed.gni")
+
+import("$dir_pw_build/python.gni")
+
+pw_python_package("py") {
+  setup = [
+    "pyproject.toml",
+    "setup.cfg",
+    "setup.py",
+  ]
+  sources = [
+    "pw_ide/__init__.py",
+    "pw_ide/__main__.py",
+  ]
+  tests = []
+  python_deps = [ "$dir_pw_console/py" ]
+  pylintrc = "$dir_pigweed/.pylintrc"
+}
diff --git a/pw_ide/py/pw_ide/__init__.py b/pw_ide/py/pw_ide/__init__.py
new file mode 100644
index 0000000..edab7cf
--- /dev/null
+++ b/pw_ide/py/pw_ide/__init__.py
@@ -0,0 +1,14 @@
+# Copyright 2022 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+"""Configure IDE support for Pigweed projects."""
diff --git a/pw_ide/py/pw_ide/__main__.py b/pw_ide/py/pw_ide/__main__.py
new file mode 100644
index 0000000..5f6ba72
--- /dev/null
+++ b/pw_ide/py/pw_ide/__main__.py
@@ -0,0 +1,25 @@
+# Copyright 2022 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+"""Configure IDE support for Pigweed projects."""
+
+import sys
+from typing import NoReturn
+
+
+def main() -> NoReturn:
+    sys.exit(0)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/pw_ide/py/pw_ide/py.typed b/pw_ide/py/pw_ide/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/pw_ide/py/pw_ide/py.typed
diff --git a/pw_ide/py/pyproject.toml b/pw_ide/py/pyproject.toml
new file mode 100644
index 0000000..ac82171
--- /dev/null
+++ b/pw_ide/py/pyproject.toml
@@ -0,0 +1,16 @@
+# Copyright 2022 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+[build-system]
+requires = ['setuptools', 'wheel']
+build-backend = 'setuptools.build_meta'
diff --git a/pw_ide/py/setup.cfg b/pw_ide/py/setup.cfg
new file mode 100644
index 0000000..b4c62e7
--- /dev/null
+++ b/pw_ide/py/setup.cfg
@@ -0,0 +1,28 @@
+# Copyright 2022 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+[metadata]
+name = pw_ide
+version = 0.0.1
+author = Pigweed Authors
+author_email = pigweed-developers@googlegroups.com
+description = Tools for Pigweed editor and IDE support
+
+[options]
+packages = find:
+
+[options.entry_points]
+console_scripts = pw-ide = pw_ide.__main__:main
+
+[options.package_data]
+pw_ide = py.typed
diff --git a/pw_ide/py/setup.py b/pw_ide/py/setup.py
new file mode 100644
index 0000000..9807aa4
--- /dev/null
+++ b/pw_ide/py/setup.py
@@ -0,0 +1,18 @@
+# Copyright 2022 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+"""pw_ide"""
+
+import setuptools  # type: ignore
+
+setuptools.setup()  # Package definition in setup.cfg