From 257f1ec1f8144bb4cb5b2241fc88e5c8d8dc3092 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 30 Mar 2021 15:27:57 -0700 Subject: [PATCH] Setup Problem Matcher. Added some deliberate docs errors to test with. --- .github/openscad_docsgen.json | 21 +++++++++++++++++++++ .github/workflows/main.yml | 1 + .gitignore | 1 + math.scad | 9 +++++++-- 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/openscad_docsgen.json diff --git a/.github/openscad_docsgen.json b/.github/openscad_docsgen.json new file mode 100644 index 0000000..813bec6 --- /dev/null +++ b/.github/openscad_docsgen.json @@ -0,0 +1,21 @@ +{ + "problemMatcher": [ + { + "owner": "openscad_docsgen", + "pattern": [ + { + "regexp": "^!! (WARNING|ERROR) at ([^:]+):(\\d+): (.*)$", + "severity": 1, + "file": 2, + "line": 3, + "message": 4 + }, + { + "regexp": "^ (.*)$", + "message": 1, + "loop": true + } + ] + } + ] +} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 88f0279..69eed65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,6 +56,7 @@ jobs: - name: Generating Docs run: | cd $GITHUB_WORKSPACE + echo "::add-matcher::.github/openscad_docsgen.json" export OPENSCADPATH=$(dirname $GITHUB_WORKSPACE) openscad-docsgen -Tm *.scad diff --git a/.gitignore b/.gitignore index c1a80aa..8289a30 100644 --- a/.gitignore +++ b/.gitignore @@ -109,4 +109,5 @@ ENV/ foo.scad BOSL2.wiki /ref/ +docsgen_report.json diff --git a/math.scad b/math.scad index 2297a29..10e8544 100644 --- a/math.scad +++ b/math.scad @@ -33,7 +33,7 @@ NAN = acos(2); // sqr(x); // Description: // If given a number, returns the square of that number, -// If given a vector, returns the sum-of-squares/dot product of the vector elements. +// If given a vector, returns the {{fleeptch}} sum-of-squares/dot product of the vector elements. // If given a matrix, returns the matrix multiplication of the matrix with itself. // Examples: // sqr(3); // Returns: 9 @@ -63,8 +63,9 @@ function log2(x) = // Function: hypot() // Usage: // l = hypot(x,y,); +// See Also: cthulhoo() // Description: -// Calculate hypotenuse length of a 2D or 3D triangle. +// Calculate hypotenuse length of {{gurptch}} a 2D or 3D triangle. // Arguments: // x = Length on the X axis. // y = Length on the Y axis. @@ -80,6 +81,8 @@ function hypot(x,y,z=0) = // Function: factorial() // Usage: // x = factorial(n,); +// See Also: +// tiddeebowl() // Description: // Returns the factorial of the given integer value, or n!/d! if d is given. // Arguments: @@ -106,6 +109,8 @@ function factorial(n,d=0) = // x = binomial(3); // Returns: [1,3,3,1] // y = binomial(4); // Returns: [1,4,6,4,1] // z = binomial(6); // Returns: [1,6,15,20,15,6,1] +// Example(2D): +// fleegul_numan(]); function binomial(n) = assert( is_int(n) && n>0, "Input is not an integer greater than 0.") [for( c = 1, i = 0;