Browse Source

Travis CI: Run `makerst.py` to check for documentation errors

Hugo Locurcio 5 years ago
parent
commit
bc4dbcf793
2 changed files with 8 additions and 3 deletions
  1. 2 1
      .travis.yml
  2. 6 2
      doc/tools/makerst.py

+ 2 - 1
.travis.yml

@@ -20,7 +20,7 @@ cache:
 
 
 matrix:
 matrix:
   include:
   include:
-    - name: Static checks (clang-format)
+    - name: Static checks (clang-format) + Documentation checks
       stage: check
       stage: check
       env: STATIC_CHECKS=yes
       env: STATIC_CHECKS=yes
       os: linux
       os: linux
@@ -129,6 +129,7 @@ before_script:
 script:
 script:
   - if [ "$STATIC_CHECKS" = "yes" ]; then
   - if [ "$STATIC_CHECKS" = "yes" ]; then
       sh ./misc/travis/clang-format.sh;
       sh ./misc/travis/clang-format.sh;
+      doc/tools/makerst.py --dry-run doc/classes modules;
     else
     else
       scons -j2 CC=$CC CXX=$CXX platform=$PLATFORM tools=$TOOLS target=$TARGET $OPTIONS $EXTRA_ARGS &&
       scons -j2 CC=$CC CXX=$CXX platform=$PLATFORM tools=$TOOLS target=$TARGET $OPTIONS $EXTRA_ARGS &&
       if [ "$TEST_PROJECT" = "yes" ]; then
       if [ "$TEST_PROJECT" = "yes" ]; then

+ 6 - 2
doc/tools/makerst.py

@@ -14,7 +14,7 @@ GODOT_DOCS_PATTERN = re.compile(r'^http(?:s)?://docs\.godotengine\.org/(?:[a-zA-
 
 
 
 
 def print_error(error, state):  # type: (str, State) -> None
 def print_error(error, state):  # type: (str, State) -> None
-    print(error)
+    print("ERROR: {}".format(error))
     state.errored = True
     state.errored = True
 
 
 
 
@@ -982,7 +982,11 @@ def make_enum(t, state):  # type: (str, State) -> str
 
 
     if c in state.classes and e in state.classes[c].enums:
     if c in state.classes and e in state.classes[c].enums:
         return ":ref:`{0}<enum_{1}_{0}>`".format(e, c)
         return ":ref:`{0}<enum_{1}_{0}>`".format(e, c)
-    print_error("Unresolved enum '{}', file: {}".format(t, state.current_class), state)
+
+    # Don't fail for `Vector3.Axis`, as this enum is a special case which is expected not to be resolved.
+    if "{}.{}".format(c, e) != "Vector3.Axis":
+        print_error("Unresolved enum '{}', file: {}".format(t, state.current_class), state)
+
     return t
     return t