Skip to content

Commit

Permalink
Fix: Address remaining Pyscaffold linting check/errors
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Watkins <[email protected]>
  • Loading branch information
ModeSevenIndustrialSolutions committed Jun 24, 2024
1 parent e602868 commit efa4f00
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tooling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
echo "Adding new file: $1"
cp "$DEVOPS_DIR/$1" "$1"
git add "$1"
elif !(cmp "$DEVOPS_DIR/$1" "$1" > /dev/null 2>&1); then
elif ! (cmp "$DEVOPS_DIR/$1" "$1" > /dev/null 2>&1); then
echo "Updating existing file: $1"
cp "$DEVOPS_DIR/$1" "$1"
git add "$1"
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
source /tmp/python-venv/bin/activate
cd "$REPO_NAME" || change_dir_error
echo "Installing PDM command..."
if !(pip install pdm setuptools > /dev/null 2>&1); then
if ! (pip install pdm setuptools > /dev/null 2>&1); then
echo "PDM installation failed"; exit 1
fi
echo -n "Validating PDM version: "
Expand All @@ -215,7 +215,7 @@ jobs:
bootstrap_new_repo() {
echo "Bootstrapping new repository"
echo "Installing pyscaffold..."
if !(pip install pyscaffold > /dev/null 2>&1); then
if ! (pip install pyscaffold > /dev/null 2>&1); then
echo "PyScaffold installation failed"; exit 1
fi
# Search and replace pyscaffold configuration file
Expand All @@ -236,7 +236,7 @@ jobs:
CURRENT_DIR=$(pwd)
if [ "$REPO_DIR" != "$CURRENT_DIR" ]; then
echo "Changing directory to: $REPO_DIR"
if !(cd "$REPO_DIR"); then
if ! (cd "$REPO_DIR"); then
echo "Error: unable to change directory"; exit 1
fi
fi
Expand Down
3 changes: 3 additions & 0 deletions src/osc_physrisk_financial/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""Instance method to initialize a newly created object."""

import sys


if sys.version_info[:2] >= (3, 8):
# TODO: Import directly (no need for conditional) when `python_requires = >= 3.8`
from importlib.metadata import PackageNotFoundError, version # pragma: no cover
Expand Down
17 changes: 9 additions & 8 deletions src/osc_physrisk_financial/skeleton.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This is a skeleton file that can serve as a starting point for a Python
console script. To run this script uncomment the following lines in the
Sample file as starting point for a Python console script.
To run this script uncomment the following lines in the
``[options.entry_points]`` section in ``setup.cfg``::
console_scripts =
Expand Down Expand Up @@ -41,7 +42,7 @@


def fib(n):
"""Fibonacci example function
"""Fibonacci example function.
Args:
n (int): integer
Expand All @@ -63,7 +64,7 @@ def fib(n):


def parse_args(args):
"""Parse command line parameters
"""Parse command line parameters.
Args:
args (List[str]): command line parameters as list of strings
Expand Down Expand Up @@ -99,7 +100,7 @@ def parse_args(args):


def setup_logging(loglevel):
"""Setup basic logging
"""Set up basic logging.
Args:
loglevel (int): minimum loglevel for emitting messages
Expand All @@ -111,7 +112,7 @@ def setup_logging(loglevel):


def main(args):
"""Wrapper allowing :func:`fib` to be called with string arguments in a CLI fashion
"""Allow :func:`fib` to be called with string arguments.
Instead of returning the value from :func:`fib`, it prints the result to the
``stdout`` in a nicely formatted message.
Expand All @@ -128,9 +129,9 @@ def main(args):


def run():
"""Calls :func:`main` passing the CLI arguments extracted from :obj:`sys.argv`
"""Create console script entry point with setuptools.
This function can be used as entry point to create console scripts with setuptools.
Calls :func:`main` passing the CLI arguments extracted from :obj:`sys.argv`
"""
main(sys.argv[1:])

Expand Down

0 comments on commit efa4f00

Please sign in to comment.