Thanks to visit codestin.com
Credit goes to github.com

Skip to content

testing poetry #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,42 @@ inputs:
description: "A list of all paths to test"
required: false
default: "."
command:
description: "Initial command specially for poetry"
required: false
default: ""
use-pylint:
description: "Use Pylint"
required: false
default: true
default: false
use-pycodestyle:
description: "Use pycodestyle"
required: false
default: true
default: false
use-flake8:
description: "Use Flake8"
required: false
default: true
default: false
use-black:
description: "Use Black"
required: false
default: true
default: false
use-mypy:
description: "Use mypy"
required: false
default: true
default: false
use-isort:
description: "Use isort"
required: false
default: true
default: false
use-vulture:
description: "Use vulture"
required: false
default: true
default: false
use-pydocstyle:
description: "Use pydocstyle"
required: false
default: true
default: false
extra-pylint-options:
description: "Extra options: pylint $(extra-pylint-options) $(python-root-list)"
required: false
Expand Down Expand Up @@ -85,22 +89,22 @@ runs:
with:
python-version: ${{ inputs.python-version }}
architecture: x64
cache: poetry
cache: ${{ inputs.cache-type }}

- run: python --version
shell: bash

- name: Windows install dependencies
if: ${{ runner.os == 'Windows' }}
run: |
pip install -r ${{ github.action_path }}\requirements.txt
echo "path_sep=" >> $GITHUB_ENV
shell: pwsh

- name: Posix install dependencies
if: ${{ runner.os != 'Windows' }}
run: pip install -r ${{ github.action_path }}/requirements.txt
shell: bash
# - name: Windows install dependencies
# if: ${{ runner.os == 'Windows' }}
# run: |
# pip install -r ${{ github.action_path }}\requirements.txt
# echo "path_sep=" >> $GITHUB_ENV
# shell: pwsh
#
# - name: Posix install dependencies
# if: ${{ runner.os != 'Windows' }}
# run: pip install -r ${{ github.action_path }}/requirements.txt
# shell: bash

- name: Lint on Windows
if: ${{ runner.os == 'Windows' }}
Expand All @@ -123,6 +127,7 @@ runs:
'${{ inputs.extra-isort-options }}'
'${{ inputs.extra-vulture-options }}'
'${{ inputs.extra-pydocstyle-options }}'
${{ inputs.command }}
shell: pwsh

- name: Lint on Linux
Expand All @@ -146,4 +151,5 @@ runs:
'${{ inputs.extra-isort-options }}'
'${{ inputs.extra-vulture-options }}'
'${{ inputs.extra-pydocstyle-options }}'
${{ inputs.command }}
shell: bash
17 changes: 9 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ echo extra-mypy-options: ${14}
echo extra-isort-options: ${15}
echo extra-vulture-options: ${16}
echo extra-pydocstyle-options: ${17}
echo command: ${18}

# actions path has the copy of this actions repo
echo $RUNNER_OS
Expand All @@ -58,7 +59,7 @@ if [ "$2" = true ] ; then

echo Running: pylint ${10} $1

pylint --output-format="colorized" ${10} $1
${18} pylint --output-format="colorized" ${10} $1
exit_code=$?

if [ "$exit_code" = "0" ]; then
Expand All @@ -73,7 +74,7 @@ if [ "$3" = true ] ; then

echo Running: pycodestyle ${11} $1

pycodestyle ${11} $1
${18} pycodestyle ${11} $1
exit_code=$?

if [ "$exit_code" = "0" ]; then
Expand All @@ -88,7 +89,7 @@ if [ "$4" = true ] ; then

echo Running: flake8 ${12} $1

flake8 ${12} $1
${18} flake8 ${12} $1
exit_code=$?

if [ "$exit_code" = "0" ]; then
Expand All @@ -103,7 +104,7 @@ if [ "$5" = true ] ; then

echo Running: black --check ${13} $1

black --check ${13} $1
${18} black --check ${13} $1
exit_code=$?

if [ "$exit_code" = "0" ]; then
Expand All @@ -118,7 +119,7 @@ if [ "$6" = true ] ; then

echo Running: mypy --install-types --non-interactive --ignore-missing-imports --follow-imports=silent --show-column-numbers ${14} $1

mypy \
${18} mypy \
--install-types --non-interactive \
--ignore-missing-imports \
--follow-imports=silent \
Expand All @@ -137,7 +138,7 @@ if [ "$7" = true ] ; then

echo Running: isort ${15} $1 -c --diff

isort ${15} $1 -c --diff
${18} isort ${15} $1 -c --diff
exit_code=$?

if [ "$exit_code" = "0" ]; then
Expand All @@ -152,7 +153,7 @@ if [ "$8" = true ] ; then

echo Running: vulture ${16} $1

vulture ${16} $1
${18} vulture ${16} $1
exit_code=$?

if [ "$exit_code" = "0" ]; then
Expand All @@ -167,7 +168,7 @@ if [ "$9" = true ] ; then

echo Running: pydocstyle ${17} $1

pydocstyle ${17} $1
${18} pydocstyle ${17} $1
exit_code=$?

if [ "$exit_code" = "0" ]; then
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# black==21.11b1
flake8==4.0.1
flake8==6.0.0
isort==5.10.1
mypy~=0.961
# pycodestyle==2.8.0
Expand Down