fix: correct lint issues and show errors on lint

This commit is contained in:
Jose Diaz-Gonzalez
2023-12-09 00:08:19 -05:00
parent b52d9bfdc8
commit 3b0c08cdc1
2 changed files with 35 additions and 32 deletions

View File

@@ -28,7 +28,7 @@ Using PIP via Github (more likely the latest version)::
Python scripts are unlikely to be included in your ``$PATH`` by default, this means it cannot be run directly in terminal with ``$ github-backup ...``, you can either add python's install path to your environments ``$PATH`` or call the script directly e.g. using ``$ ~/.local/bin/github-backup``.*
Basic Help
===========
==========
Show the CLI help output::
@@ -220,7 +220,7 @@ Cloning all starred size
Using the ``--all-starred`` argument to clone all starred repositories may use a large amount of storage space, especially if ``--all`` or more arguments are used. e.g. commonly starred repos can have tens of thousands of issues, many large assets and the repo itself etc. Consider just storing links to starred repos in JSON format with ``--starred``.
Incremental Backup
-------------------
------------------
Using (``-i, --incremental``) will only request new data from the API **since the last run (successful or not)**. e.g. only request issues from the API since the last run.
@@ -249,7 +249,7 @@ It's therefore recommended to only use the incremental argument if the output/re
"bare" is actually "mirror"
--------------------------
---------------------------
Using the bare clone argument (``--bare``) will actually call git's ``clone --mirror`` command. There's a subtle difference between `bare <https://www.git-scm.com/docs/git-clone#Documentation/git-clone.txt---bare>`_ and `mirror <https://www.git-scm.com/docs/git-clone#Documentation/git-clone.txt---mirror>`_ clone.
@@ -263,13 +263,13 @@ The starred normal repo cloning (``--all-starred``) argument stores starred repo
Skip existing on incomplete backups
-------------------------------------------------------
-----------------------------------
The ``--skip-existing`` argument will skip a backup if the directory already exists, even if the backup in that directory failed (perhaps due to a blocking error). This may result in unexpected missing data in a regular backup.
Github Backup Examples
========
======================
Backup all repositories, including private ones using a classic token::

19
release
View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $RELEASE_TRACE ]] && set -x
set -eo pipefail
[[ $RELEASE_TRACE ]] && set -x
if [[ ! -f setup.py ]]; then
echo -e "${RED}WARNING: Missing setup.py${COLOR_OFF}\n"
@@ -43,13 +44,13 @@ fi
echo -e "\n${GREEN}STARTING RELEASE PROCESS${COLOR_OFF}\n"
set +e;
set +e
git status | grep -Eo "working (directory|tree) clean" &>/dev/null
if [ ! $? -eq 0 ]; then # working directory is NOT clean
echo -e "${RED}WARNING: You have uncomitted changes, you may have forgotten something${COLOR_OFF}\n"
exit 1
fi
set -e;
set -e
echo -e "${YELLOW}--->${COLOR_OFF} Updating local copy"
git pull -q origin master
@@ -62,14 +63,14 @@ minor=$(echo $current_version | awk '{split($0,a,"."); print a[2]}')
patch=$(echo $current_version | awk '{split($0,a,"."); print a[3]}')
if [[ "$@" == "major" ]]; then
major=$(($major + 1));
major=$(($major + 1))
minor="0"
patch="0"
elif [[ "$@" == "minor" ]]; then
minor=$(($minor + 1));
minor=$(($minor + 1))
patch="0"
elif [[ "$@" == "patch" ]]; then
patch=$(($patch + 1));
patch=$(($patch + 1))
fi
next_version="${major}.${minor}.${patch}"
@@ -77,7 +78,7 @@ next_version="${major}.${minor}.${patch}"
echo -e "${YELLOW} >${COLOR_OFF} ${MAGENTA}${current_version}${COLOR_OFF} -> ${MAGENTA}${next_version}${COLOR_OFF}"
echo -e "${YELLOW}--->${COLOR_OFF} Ensuring readme passes lint checks (if this fails, run rst-lint)"
rst-lint README.rst > /dev/null
rst-lint README.rst || exit 1
echo -e "${YELLOW}--->${COLOR_OFF} Creating necessary temp file"
tempfoo=$(basename $0)
@@ -105,7 +106,9 @@ fi
echo -e "${YELLOW}--->${COLOR_OFF} Updating CHANGES.rst for new release"
version_header="$next_version ($(date +%F))"
set +e; dashes=$(yes '-'|head -n ${#version_header}|tr -d '\n') ; set -e
set +e
dashes=$(yes '-' | head -n ${#version_header} | tr -d '\n')
set -e
gitchangelog | sed "4s/.*/$version_header/" | sed "5s/.*/$dashes/" >$TMPFILE && mv $TMPFILE CHANGES.rst
echo -e "${YELLOW}--->${COLOR_OFF} Adding changed files to git"