Skip to content
Snippets Groups Projects
Commit 0a036718 authored by Bas van der Tol's avatar Bas van der Tol
Browse files

Merge branch 'ast-1565-parse-direction-label-after-point-clause' into 'master'

Parse direction label after point clause and sort Python imports

See merge request !151
parents 8e43e442 08bdfb94
No related branches found
No related tags found
1 merge request!151Parse direction label after point clause and sort Python imports
Pipeline #88977 passed
......@@ -18,4 +18,4 @@ RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get upgrade -
&& ln -sf clang-tidy-12 /usr/bin/clang-tidy \
# 20220624: The latest GCOVR (5.1) is broken, so use 5.0.
# jinja2<3.1 is required for the html details of GCOVR 5.0
&& python3 -m pip install gcovr==5.0 'jinja2<3.1' cmake-format
\ No newline at end of file
&& python3 -m pip install gcovr==5.0 'jinja2<3.1' cmake-format isort
\ No newline at end of file
......@@ -18,4 +18,4 @@ RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get upgrade -
&& ln -sf clang-tidy-12 /usr/bin/clang-tidy \
# 20220624: The latest GCOVR (5.1) is broken, so use 5.0.
# jinja2<3.1 is required for the html details of GCOVR 5.0
&& python3 -m pip install gcovr==5.0 'jinja2<3.1' black cmake-format
\ No newline at end of file
&& python3 -m pip install gcovr==5.0 'jinja2<3.1' black cmake-format isort
\ No newline at end of file
......@@ -106,6 +106,11 @@ class DS9FacetFile {
direction_label = ParseDirectionLabel(Type(), Token());
} else if (t == "point" && !coordinates.empty()) {
direction = ReadPoint();
const std::string direction_label_point =
ParseDirectionLabel(Type(), Token());
if (direction_label_point != "") {
direction_label = direction_label_point;
}
}
}
}
......
......@@ -78,6 +78,9 @@ PYTHON_FILES=$(git ls-files $PYTHON_FILES_EXCLUDEDIRS)
# Use line length 79, which complies with PEP-8.
BLACK="black -l 79"
# Sort imports according to PEP-8
ISORT="isort --profile black"
if [[ "${CLANG_FORMAT_BINARY}" == "" ]] ; then
CLANG_FORMAT_BINARY="clang-format"
fi
......@@ -87,7 +90,8 @@ if [ -n "$DRYRUN" ]; then
if !(${CLANG_FORMAT_BINARY} -style=file --output-replacements-xml $CXX_FILES |
grep -q "<replacement ") &&
cmake-format --check $CMAKE_FILES &&
$BLACK --check $PYTHON_FILES; then
$BLACK --check $PYTHON_FILES &&
$ISORT --check $PYTHON_FILES; then
# Print in bold-face green
echo -e "\e[1m\e[32mGreat job, all files are properly formatted!\e[0m"
else
......@@ -100,6 +104,7 @@ else
${CLANG_FORMAT_BINARY} -i -style=file $CXX_FILES
cmake-format -i $CMAKE_FILES
$BLACK -q $PYTHON_FILES
$ISORT -q $PYTHON_FILES
# Print in bold-face
echo -e "\e[1mSuccessfully formatted all files.\e[0m"
fi
......@@ -14,8 +14,10 @@ polygon(23.0,30.5, 23.0,31.5, 21.0,31.5, 21.0,30.5) # text=CygA
point(23.0,31.5)
# Ra@(400,256). Polygon is (364,129) (366,301) (541,305) (547,128).
polygon(23.15,31.88, 23.10,33.6, 21.0,33.6, 21.0,31.83) # text=CygAO
point(23.10,33.6)
polygon(23.15,31.88, 23.10,33.6, 21.0,33.6, 21.0,31.83)
# Text label is given after point(...) instead of after polygon(...)
# This label should be parsed as well
point(23.10,33.6) # text=CygAO
# Dec@(256,64). Polygon is (128,-9) (128,128) (384,128) (384,-9).
polygon(25.91,30.5, 25.93,31.87, 22.92,31.87, 22.94,30.5) # text=CygTJ
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment