From d8628d5887e7d890982a4f8801aa7274ee437645 Mon Sep 17 00:00:00 2001 From: leeyspaul Date: Wed, 10 Jul 2019 21:50:14 -0700 Subject: [PATCH 1/7] format isort output --- ci/code_checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 1494452ca136b..abe351afd9d4b 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -109,7 +109,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then # Imports - Check formatting using isort see setup.cfg for settings MSG='Check import format using isort ' ; echo $MSG - isort --recursive --check-only pandas asv_bench + isort --recursive --check-only pandas asv_bench | awk -F ":" '##vso[task.logissue type=error;sourcepath=%(path)s]%(text)s' RET=$(($RET + $?)) ; echo $MSG "DONE" fi From c7a64c376af289929fead1dc092c25abdf006b01 Mon Sep 17 00:00:00 2001 From: leeyspaul Date: Thu, 11 Jul 2019 20:37:03 -0700 Subject: [PATCH 2/7] refactor isort formatting --- ci/code_checks.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index abe351afd9d4b..8545f0fe1c9bf 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -45,8 +45,10 @@ function invgrep { if [[ "$AZURE" == "true" ]]; then FLAKE8_FORMAT="##vso[task.logissue type=error;sourcepath=%(path)s;linenumber=%(row)s;columnnumber=%(col)s;code=%(code)s;]%(text)s" + ISORT_FORMAT="##vso[task.logissue type=error;sourcepath=%(path)s]%(text)s" else FLAKE8_FORMAT="default" + ISORT_FORMAT="default" fi ### LINTING ### @@ -109,7 +111,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then # Imports - Check formatting using isort see setup.cfg for settings MSG='Check import format using isort ' ; echo $MSG - isort --recursive --check-only pandas asv_bench | awk -F ":" '##vso[task.logissue type=error;sourcepath=%(path)s]%(text)s' + isort --recursive --check-only pandas asv_bench | awk -F ":" $ISORT_FORMAT RET=$(($RET + $?)) ; echo $MSG "DONE" fi From 7762fc11a84ff646c81c4f234eeb0fb0bedde485 Mon Sep 17 00:00:00 2001 From: leeyspaul Date: Thu, 11 Jul 2019 20:37:31 -0700 Subject: [PATCH 3/7] intentional misordering of imports to test ci failure --- pandas/plotting/_matplotlib/core.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py index d25715e6d167b..2ce7460060e41 100644 --- a/pandas/plotting/_matplotlib/core.py +++ b/pandas/plotting/_matplotlib/core.py @@ -2,6 +2,20 @@ from typing import Optional # noqa import warnings +from pandas.io.formats.printing import pprint_thing +from pandas.plotting._matplotlib import converter +from pandas.plotting._matplotlib.compat import _mpl_ge_3_0_0 +from pandas.plotting._matplotlib.style import _get_standard_colors +from pandas.plotting._matplotlib.tools import ( + _flatten, + _get_all_lines, + _get_xlim, + _handle_shared_axes, + _subplots, + format_date_labels, + table, +) + import numpy as np from pandas._config import get_option @@ -27,19 +41,6 @@ import pandas.core.common as com -from pandas.io.formats.printing import pprint_thing -from pandas.plotting._matplotlib import converter -from pandas.plotting._matplotlib.compat import _mpl_ge_3_0_0 -from pandas.plotting._matplotlib.style import _get_standard_colors -from pandas.plotting._matplotlib.tools import ( - _flatten, - _get_all_lines, - _get_xlim, - _handle_shared_axes, - _subplots, - format_date_labels, - table, -) if get_option("plotting.matplotlib.register_converters"): converter.register(explicit=False) From d2f9874fce5575a58e69019406764dd01db743c9 Mon Sep 17 00:00:00 2001 From: leeyspaul Date: Thu, 11 Jul 2019 21:04:37 -0700 Subject: [PATCH 4/7] change isort formatting fix isort formatting for awk fix isort format output test awk change fix isort output for azure remove comment fix deliberate import errors fix whitespace whitespace fix --- ci/code_checks.sh | 9 +++++---- pandas/plotting/_matplotlib/core.py | 27 +++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 8545f0fe1c9bf..4411a3f7c8018 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -45,10 +45,8 @@ function invgrep { if [[ "$AZURE" == "true" ]]; then FLAKE8_FORMAT="##vso[task.logissue type=error;sourcepath=%(path)s;linenumber=%(row)s;columnnumber=%(col)s;code=%(code)s;]%(text)s" - ISORT_FORMAT="##vso[task.logissue type=error;sourcepath=%(path)s]%(text)s" else FLAKE8_FORMAT="default" - ISORT_FORMAT="default" fi ### LINTING ### @@ -111,9 +109,12 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then # Imports - Check formatting using isort see setup.cfg for settings MSG='Check import format using isort ' ; echo $MSG - isort --recursive --check-only pandas asv_bench | awk -F ":" $ISORT_FORMAT + if [[ "$AZURE" == "true" ]]; then + isort --recursive --check-only pandas asv_bench | awk -F ':' '{print $0"\n" "##vso[task.logissue type=error;sourcepath=%(path)s]%(text)s"}' + else + isort --recursive --check-only pandas asv_bench | awk -F ':' '{print}' + fi RET=$(($RET + $?)) ; echo $MSG "DONE" - fi ### PATTERNS ### diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py index 2ce7460060e41..d25715e6d167b 100644 --- a/pandas/plotting/_matplotlib/core.py +++ b/pandas/plotting/_matplotlib/core.py @@ -2,20 +2,6 @@ from typing import Optional # noqa import warnings -from pandas.io.formats.printing import pprint_thing -from pandas.plotting._matplotlib import converter -from pandas.plotting._matplotlib.compat import _mpl_ge_3_0_0 -from pandas.plotting._matplotlib.style import _get_standard_colors -from pandas.plotting._matplotlib.tools import ( - _flatten, - _get_all_lines, - _get_xlim, - _handle_shared_axes, - _subplots, - format_date_labels, - table, -) - import numpy as np from pandas._config import get_option @@ -41,6 +27,19 @@ import pandas.core.common as com +from pandas.io.formats.printing import pprint_thing +from pandas.plotting._matplotlib import converter +from pandas.plotting._matplotlib.compat import _mpl_ge_3_0_0 +from pandas.plotting._matplotlib.style import _get_standard_colors +from pandas.plotting._matplotlib.tools import ( + _flatten, + _get_all_lines, + _get_xlim, + _handle_shared_axes, + _subplots, + format_date_labels, + table, +) if get_option("plotting.matplotlib.register_converters"): converter.register(explicit=False) From 35861cf9c72254e2005376c66cca5a8e3ea3ed20 Mon Sep 17 00:00:00 2001 From: leeyspaul Date: Mon, 29 Jul 2019 06:08:57 -0700 Subject: [PATCH 5/7] address pr comments and deliberate bad imports ordering fix output test azuredev output fix awk output to show path reformat output to incorporate error msg format output to catch path and error name --- ci/code_checks.sh | 5 +++-- pandas/plotting/_matplotlib/core.py | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 4411a3f7c8018..c6914ff43b973 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -110,11 +110,12 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then # Imports - Check formatting using isort see setup.cfg for settings MSG='Check import format using isort ' ; echo $MSG if [[ "$AZURE" == "true" ]]; then - isort --recursive --check-only pandas asv_bench | awk -F ':' '{print $0"\n" "##vso[task.logissue type=error;sourcepath=%(path)s]%(text)s"}' + isort --recursive --check-only pandas asv_bench | awk '{print "##vso[task.logissue type=error;sourcepath="$2" "substr($0, index($3, $7))""}' else - isort --recursive --check-only pandas asv_bench | awk -F ':' '{print}' + isort --recursive --check-only pandas asv_bench | awk -F ':' '{print $0}' fi RET=$(($RET + $?)) ; echo $MSG "DONE" + fi ### PATTERNS ### diff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py index d25715e6d167b..62e6073e8c01f 100644 --- a/pandas/plotting/_matplotlib/core.py +++ b/pandas/plotting/_matplotlib/core.py @@ -2,6 +2,20 @@ from typing import Optional # noqa import warnings +from pandas.io.formats.printing import pprint_thing +from pandas.plotting._matplotlib import converter +from pandas.plotting._matplotlib.compat import _mpl_ge_3_0_0 +from pandas.plotting._matplotlib.style import _get_standard_colors +from pandas.plotting._matplotlib.tools import ( + _flatten, + _get_all_lines, + _get_xlim, + _handle_shared_axes, + _subplots, + format_date_labels, + table, +) + import numpy as np from pandas._config import get_option @@ -27,20 +41,6 @@ import pandas.core.common as com -from pandas.io.formats.printing import pprint_thing -from pandas.plotting._matplotlib import converter -from pandas.plotting._matplotlib.compat import _mpl_ge_3_0_0 -from pandas.plotting._matplotlib.style import _get_standard_colors -from pandas.plotting._matplotlib.tools import ( - _flatten, - _get_all_lines, - _get_xlim, - _handle_shared_axes, - _subplots, - format_date_labels, - table, -) - if get_option("plotting.matplotlib.register_converters"): converter.register(explicit=False) From 031692332b085f21cbac689716b140abecae79a4 Mon Sep 17 00:00:00 2001 From: leeyspaul Date: Fri, 2 Aug 2019 22:29:37 -0700 Subject: [PATCH 6/7] fix error output substr --- ci/code_checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index c6914ff43b973..18c663cf5c8ee 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -110,7 +110,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then # Imports - Check formatting using isort see setup.cfg for settings MSG='Check import format using isort ' ; echo $MSG if [[ "$AZURE" == "true" ]]; then - isort --recursive --check-only pandas asv_bench | awk '{print "##vso[task.logissue type=error;sourcepath="$2" "substr($0, index($3, $7))""}' + isort --recursive --check-only pandas asv_bench | awk '{print "##vso[task.logissue type=error;sourcepath="$2";]"substr($0, index($3, $7))""}' else isort --recursive --check-only pandas asv_bench | awk -F ':' '{print $0}' fi From 1368f872541a31babe100207411bd5a5420b844c Mon Sep 17 00:00:00 2001 From: leeyspaul Date: Sat, 3 Aug 2019 09:14:54 -0700 Subject: [PATCH 7/7] formatting output to only have error msg --- ci/code_checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 18c663cf5c8ee..d93ae309a0015 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -110,7 +110,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then # Imports - Check formatting using isort see setup.cfg for settings MSG='Check import format using isort ' ; echo $MSG if [[ "$AZURE" == "true" ]]; then - isort --recursive --check-only pandas asv_bench | awk '{print "##vso[task.logissue type=error;sourcepath="$2";]"substr($0, index($3, $7))""}' + isort --recursive --check-only pandas asv_bench | awk '{ORS=""} {print "##vso[task.logissue type=error;sourcepath="$2";]"} {$1=$2=""; print $0}' else isort --recursive --check-only pandas asv_bench | awk -F ':' '{print $0}' fi