xUnique icon indicating copy to clipboard operation
xUnique copied to clipboard

sort sections

Open SolaWing opened this issue 8 years ago • 4 comments

as #17, I rewrote sort to support sorting sections. This will ease the pain of Xcode reordering sections and causing huge modifications.

SolaWing avatar Aug 06 '16 01:08 SolaWing

@SolaWing hi, sorry for the late reply. Thanks for your PR. As this one is a major change, have you tested on any project file? I think the quick and lazy verification test is to find some complicated project files being xuniqued twice, to see if they were the same without any error exit.

truebit avatar Oct 15 '16 08:10 truebit

not fully tested, but this PR did solve section sorting problem for my case, without any other side effect @truebit

ZSaberLv0 avatar May 21 '17 08:05 ZSaberLv0

After the first PR, I also fixed some found problem. The final commit has been used in our team 1 year without any problem.

Maybe we should add auto test?

following is our team's precommithook:

IFS=$'\n' projs=($(git diff --name-only --cached --diff-filter=ACM | grep -o '[a-zA-Z0-9_./]\+\.xcodeproj/project.pbxproj'))
if ((${#projs[@]} > 0)); then
    if command -v python3 >/dev/null 2>&1; then
        py='python3'
    else
        py='python'
    fi
    # set -x
    for proj in ${projs[@]}; do
        $py xUnique.py -c "$proj";
        ret=$?
        if (($ret == 100)); then
            git add "$proj"
        elif (($ret > 0)); then
            echo 'xcodeproj file may broken! check the exception message please'
            echo 'you may add `--no-verify` option for commit to skip checking xcodeproj'
            exit 1
        fi
    done
    if [[ ! $(git diff --name-only --cached | grep -o '[a-zA-Z0-9_./]\+\.xcodeproj/project.pbxproj') ]]; then
        echo 'no changes, commit abort'
        exit 1
    fi
fi

SolaWing avatar Oct 05 '17 03:10 SolaWing

@SolaWing Thanks for the input. auto test is not a very good alternative, as special project files causing problems are normally from private code, those files cannot be included as a testcase 😟

truebit avatar Oct 16 '17 10:10 truebit