-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
MAINT: Fix LGTM.com error: Unmatchable caret in regular expression #19913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1306160 to
8c15f9a
Compare
What are you referring to by |
|
From README.rst:
I'm puzzled, since |
My guess was that it was blindly converted to Python3 without thought, and has not been run for a long time. |
|
Should |
|
Anything that puts |
|
Oh, the files themselves had been regenerated back in 2020 (#15224). I'll try to revert to that version instead. |
|
I think any changes which added Python 3 support are fine (in case anyone ever decides to port plex in future), it's the ones that removed Python 2 support which were in error. Certainly we need a docstring indicating that these are python2 scripts! |
|
Fine. Also, I suggest changing the shebang from |
|
Removing the caret from the regex does generate some matches. Here are the diffs: diff --git a/numpy/linalg/lapack_lite/f2c_blas.c b/numpy/linalg/lapack_lite/f2c_blas.c
index 65286892f..ceb9ba0b4 100644
--- a/numpy/linalg/lapack_lite/f2c_blas.c
+++ b/numpy/linalg/lapack_lite/f2c_blas.c
@@ -4008,7 +4008,6 @@ L20:
return 0;
} /* csrot_ */
-/* Subroutine */ int csscal_(integer *n, real *sa, complex *cx, integer *incx)
{
/* System generated locals */
integer i__1, i__2, i__3, i__4;
@@ -12424,7 +12423,6 @@ L20:
return 0;
} /* srot_ */
-/* Subroutine */ int sscal_(integer *n, real *sa, real *sx, integer *incx)
{
/* System generated locals */
integer i__1, i__2;
diff --git a/numpy/linalg/lapack_lite/f2c_c_lapack.c b/numpy/linalg/lapack_lite/f2c_c_lapack.c
index c36c0e368..37cc19630 100644
--- a/numpy/linalg/lapack_lite/f2c_c_lapack.c
+++ b/numpy/linalg/lapack_lite/f2c_c_lapack.c
@@ -8875,7 +8875,6 @@ L10:
} /* clabrd_ */
-/* Subroutine */ int clacgv_(integer *n, complex *x, integer *incx)
{
/* System generated locals */
integer i__1, i__2;
diff --git a/numpy/linalg/lapack_lite/f2c_config.c b/numpy/linalg/lapack_lite/f2c_config.c
index 3f59e0263..d40c1d63f 100644
--- a/numpy/linalg/lapack_lite/f2c_config.c
+++ b/numpy/linalg/lapack_lite/f2c_config.c
@@ -727,7 +727,6 @@ doublereal dlamc3_(doublereal *a, doublereal *b)
/* *********************************************************************** */
-/* Subroutine */ int dlamc4_(integer *emin, doublereal *start, integer *base)
{
/* System generated locals */
integer i__1;
@@ -1797,7 +1796,6 @@ doublereal slamc3_(real *a, real *b)
/* *********************************************************************** */
-/* Subroutine */ int slamc4_(integer *emin, real *start, integer *base)
{
/* System generated locals */
integer i__1;
diff --git a/numpy/linalg/lapack_lite/f2c_d_lapack.c b/numpy/linalg/lapack_lite/f2c_d_lapack.c
index 233db74b9..bb2412b3c 100644
--- a/numpy/linalg/lapack_lite/f2c_d_lapack.c
+++ b/numpy/linalg/lapack_lite/f2c_d_lapack.c
@@ -7965,7 +7965,6 @@ logical disnan_(doublereal *din)
return ret_val;
} /* disnan_ */
-/* Subroutine */ int dlabad_(doublereal *small, doublereal *large)
{
/*
@@ -29214,7 +29213,6 @@ L100:
} /* dlasq1_ */
-/* Subroutine */ int dlasq2_(integer *n, doublereal *z__, integer *info)
{
/* System generated locals */
integer i__1, i__2, i__3;
diff --git a/numpy/linalg/lapack_lite/f2c_s_lapack.c b/numpy/linalg/lapack_lite/f2c_s_lapack.c
index 2a32315c7..8333e6c04 100644
--- a/numpy/linalg/lapack_lite/f2c_s_lapack.c
+++ b/numpy/linalg/lapack_lite/f2c_s_lapack.c
@@ -7945,7 +7945,6 @@ logical sisnan_(real *sin__)
return ret_val;
} /* sisnan_ */
-/* Subroutine */ int slabad_(real *small, real *large)
{
/*
@@ -8562,7 +8561,6 @@ logical sisnan_(real *sin__)
} /* sladiv_ */
-/* Subroutine */ int slae2_(real *a, real *b, real *c__, real *rt1, real *rt2)
{
/* System generated locals */
real r__1;
@@ -23399,7 +23397,6 @@ L410:
} /* slarfx_ */
-/* Subroutine */ int slartg_(real *f, real *g, real *cs, real *sn, real *r__)
{
/* System generated locals */
integer i__1;
@@ -29103,7 +29100,6 @@ L100:
} /* slasq1_ */
-/* Subroutine */ int slasq2_(integer *n, real *z__, integer *info)
{
/* System generated locals */
integer i__1, i__2, i__3;
@@ -31213,7 +31209,6 @@ L80:
} /* slasr_ */
-/* Subroutine */ int slasrt_(char *id, integer *n, real *d__, integer *info)
{
/* System generated locals */
integer i__1, i__2;
@@ -38357,7 +38352,6 @@ L190:
} /* ssteqr_ */
-/* Subroutine */ int ssterf_(integer *n, real *d__, real *e, integer *info)
{
/* System generated locals */
integer i__1;
diff --git a/numpy/linalg/lapack_lite/f2c_z_lapack.c b/numpy/linalg/lapack_lite/f2c_z_lapack.c
index 8234eca41..e5a41e64c 100644
--- a/numpy/linalg/lapack_lite/f2c_z_lapack.c
+++ b/numpy/linalg/lapack_lite/f2c_z_lapack.c
@@ -8930,7 +8930,6 @@ L10:
} /* zlabrd_ */
-/* Subroutine */ int zlacgv_(integer *n, doublecomplex *x, integer *incx)
{
/* System generated locals */
integer i__1, i__2;
|
|
This regex was introduced in #10477, with the caret. It was supposed to "align type definitions", not sure what that means. Any clue whether the declarations of |
Unmatchable caret in regular expression This regular expression includes an unmatchable caret at offset 18. Indeed this regex couldn't possibly match anything. Not only does the regex look obsolete, attempting to match "inline" or "static" specifiers that I cannot find in the sources produced by 'f2c', but the very logic of function removeSubroutinePrototypes() makes it impossible to handle '/* Subroutine */' declarations that span multiple lines. All in all, function removeSubroutinePrototypes() does nothing at all. We choose not to change that, because it works and we have no real hint what it should do and why. We just document that.
8c15f9a to
34efd69
Compare
|
I have sort of discarded |
|
@DimitriPapadopoulos Yes, |
|
Thanks @DimitriPapadopoulos . |
https://lgtm.com/projects/g/numpy/numpy/snapshot/8b1ae13424d3f203fb21b3063a03b80358fadfcf/files/numpy/linalg/lapack_lite/clapack_scrub.py#x56fba2496b1bf29c:1
Indeed this regex couldn't possibly match anything.
Note that this regex seems obsolete, it attempts to match "
inline" or "static" specifiers, which I cannot find in the C files generated byf2cfrom LAPACK. Typical declarations look like this:EDIT: Removed any reference to CLAPACK, it was confusing.