fix build errors related to updated static code analysis tools for python and php
diff --git a/build/docker/scripts/sca.sh b/build/docker/scripts/sca.sh
index f26ce95..16d5826 100755
--- a/build/docker/scripts/sca.sh
+++ b/build/docker/scripts/sca.sh
@@ -39,7 +39,7 @@
cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
# Python code style
-flake8 --ignore=E501 --exclude=lib/py/build lib/py
+flake8 --ignore=W504,E501 lib/py
flake8 --exclude=tutorial/py/build tutorial/py
# THRIFT-4371 : generated files are excluded because they haven't been scrubbed yet
flake8 --ignore=E501 --exclude="*/gen-py*/*",test/py/build test/py
diff --git a/lib/php/lib/Base/TBase.php b/lib/php/lib/Base/TBase.php
index f2c514a..c61b631 100644
--- a/lib/php/lib/Base/TBase.php
+++ b/lib/php/lib/Base/TBase.php
@@ -33,7 +33,7 @@
*/
abstract class TBase
{
- static public $tmethod = array(
+ public static $tmethod = array(
TType::BOOL => 'Bool',
TType::BYTE => 'Byte',
TType::I16 => 'I16',
diff --git a/lib/php/lib/Exception/TApplicationException.php b/lib/php/lib/Exception/TApplicationException.php
index 228add5..ebb6a6a 100644
--- a/lib/php/lib/Exception/TApplicationException.php
+++ b/lib/php/lib/Exception/TApplicationException.php
@@ -26,7 +26,7 @@
class TApplicationException extends TException
{
- static public $_TSPEC =
+ public static $_TSPEC =
array(1 => array('var' => 'message',
'type' => TType::STRING),
2 => array('var' => 'code',
diff --git a/lib/php/lib/Exception/TException.php b/lib/php/lib/Exception/TException.php
index e9c7c71..7dbf832 100644
--- a/lib/php/lib/Exception/TException.php
+++ b/lib/php/lib/Exception/TException.php
@@ -56,7 +56,7 @@
}
}
- static public $tmethod = array(
+ public static $tmethod = array(
TType::BOOL => 'Bool',
TType::BYTE => 'Byte',
TType::I16 => 'I16',
diff --git a/test/crossrunner/run.py b/test/crossrunner/run.py
index a7bc939..ef8fb60 100644
--- a/test/crossrunner/run.py
+++ b/test/crossrunner/run.py
@@ -152,7 +152,7 @@
return ExecutionContext(prog.command, prog.workdir, prog.env, prog.stop_signal, is_server, report)
-def run_test(testdir, logdir, test_dict, max_retry, async=True):
+def run_test(testdir, logdir, test_dict, max_retry, async_mode=True):
logger = multiprocessing.get_logger()
def ensure_socket_open(sv, port, test):
@@ -255,13 +255,13 @@
logger.info('[%s-%s]: test failed, retrying...', test.server.name, test.client.name)
retry_count += 1
except Exception:
- if not async:
+ if not async_mode:
raise
logger.warn('Error executing [%s]', test.name, exc_info=True)
return (retry_count, RESULT_ERROR)
except:
logger.info('Interrupted execution', exc_info=True)
- if not async:
+ if not async_mode:
raise
stop.set()
return (retry_count, RESULT_ERROR)
@@ -385,7 +385,7 @@
ports = m.ports()
def _dispatch_sync(self, test, cont, max_retry):
- r = run_test(self.testdir, self.logdir, test, max_retry, False)
+ r = run_test(self.testdir, self.logdir, test, max_retry, async_mode=False)
cont(r)
return NonAsyncResult(r)