MariuszSkamra commented on code in PR #1712:
URL: https://github.com/apache/mynewt-nimble/pull/1712#discussion_r1505500884


##########
.github/check_doxygen.py:
##########
@@ -0,0 +1,112 @@
+#!/usr/bin/env python3
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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
+#
+#  http://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 os
+import re
+import subprocess
+import sys
+from pathlib import Path
+
+TMP_FOLDER = "/tmp/doxygen_check"
+WARN_FILE_NAME = "warnings.log"
+
+
+def run_cmd(cmd: str) -> list[str]:
+    out = subprocess.check_output(cmd, text=True, shell=True)
+    return out.splitlines()
+
+
+def run_cmd_no_check(cmd: str) -> list[str]:
+    out = subprocess.run(cmd, text=True, shell=True, stdout=subprocess.PIPE,
+                         stderr=subprocess.DEVNULL).stdout
+    return out.splitlines()
+
+
+def is_ignored(filename: str) -> bool:
+    if Path(filename).suffix != ".h" or "priv" in filename:
+        return True
+    if filename == "nimble/include/nimble/ble.h":
+        return False

Review Comment:
   Why this particular file is about to be ignored?
   
   Consider having a list of ignored files that can be easily extended in the 
future.
   ```
   ignored_files = [
      "nimble/include/nimble/ble.h",
   ]
   
   (...)
   
   if (filename in ignored_files):
     return False
   ```



##########
.github/check_doxygen.py:
##########
@@ -0,0 +1,112 @@
+#!/usr/bin/env python3
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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
+#
+#  http://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 os
+import re
+import subprocess
+import sys
+from pathlib import Path
+
+TMP_FOLDER = "/tmp/doxygen_check"
+WARN_FILE_NAME = "warnings.log"
+
+
+def run_cmd(cmd: str) -> list[str]:
+    out = subprocess.check_output(cmd, text=True, shell=True)
+    return out.splitlines()
+
+
+def run_cmd_no_check(cmd: str) -> list[str]:
+    out = subprocess.run(cmd, text=True, shell=True, stdout=subprocess.PIPE,
+                         stderr=subprocess.DEVNULL).stdout
+    return out.splitlines()
+
+
+def is_ignored(filename: str) -> bool:
+    if Path(filename).suffix != ".h" or "priv" in filename:
+        return True
+    if filename == "nimble/include/nimble/ble.h":
+        return False
+    if re.search(r"nimble/host.*include.*", filename):
+        return False
+
+    return True
+
+
+def main() -> bool:
+    if len(sys.argv) > 1:
+        commit = sys.argv[1]
+    else:
+        commit = "HEAD"
+    if len(sys.argv) > 2:
+        upstream = sys.argv[2]
+    else:
+        upstream = "origin/master"

Review Comment:
   Nitpick: (but can be useful) consider using argparse for command line 
parameters, to describe the possible options



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to