Skip to content

Commit ed16e8e

Browse files
committed
Changed using custom test for pylint to opencv sample
1 parent 1e26c5d commit ed16e8e

7 files changed

+24
-8
lines changed

.github/workflows/build_wheels_linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
- name: Checkout
103103
uses: actions/checkout@v2
104104
with:
105-
submodules: false
105+
submodules: true
106106
fetch-depth: 0
107107

108108
- name: Setup Environment variables

.github/workflows/build_wheels_macos.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ jobs:
137137
CONFIG_PATH: travis_config.sh
138138
PLAT: x86_64
139139
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata
140+
PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py
140141

141142
steps:
142143
- name: Checkout
@@ -174,7 +175,8 @@ jobs:
174175
- name: Pylint test
175176
run: |
176177
python -m pip install pylint==2.12.2
177-
python -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring
178+
cd ${{ github.workspace }}/tests
179+
python -m pylint $PYLINT_TEST_FILE
178180
179181
test_release_opencv_python:
180182
if: github.event_name == 'release' && github.event.release.prerelease

.github/workflows/build_wheels_macos_m1.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181

8282
env:
8383
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata
84+
PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py
8485

8586
steps:
8687
- name: Checkout
@@ -109,7 +110,8 @@ jobs:
109110
- name: Pylint test
110111
run: |
111112
arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.12.2
112-
arch -arm64 python${{ matrix.python-version }} -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring
113+
cd ${{ github.workspace }}/tests
114+
arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE
113115
114116
test_release_opencv_python:
115117
if: github.event_name == 'release' && github.event.release.prerelease

.github/workflows/build_wheels_windows.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696
env:
9797
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
9898
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata
99+
PYLINT_TEST_FILE: ${{ github.workspace }}\opencv\samples\python\squares.py
99100

100101
steps:
101102
- name: Checkout
@@ -133,7 +134,8 @@ jobs:
133134
- name: Pylint test
134135
run: |
135136
python -m pip install pylint==2.12.2
136-
python -m pylint ${{ github.workspace }}\tests\pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring
137+
cd ${{ github.workspace }}\tests
138+
python -m pylint $PYLINT_TEST_FILE
137139
shell: cmd
138140

139141
test_release_opencv_python:

tests/pylint.py

-3
This file was deleted.

tests/pylintrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Source: opencv/platforms/scripts/pylintrc
2+
3+
[MESSAGES CONTROL]
4+
5+
# Disable all to choose the Tests one by one
6+
disable=all
7+
8+
# Tests
9+
enable=bad-indentation, # Used when an unexpected number of indentation’s tabulations or spaces has been found.
10+
mixed-indentation, # Used when there are some mixed tabs and spaces in a module.
11+
unnecessary-semicolon, # Used when a statement is ended by a semi-colon (”;”), which isn’t necessary.
12+
unused-variable # Used when a variable is defined but not used. (Use _var to ignore var).

travis_config.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ function pylint_test {
169169
echo "Starting Pylint tests..."
170170

171171
$PYTHON -m pip install pylint==2.12.2
172-
$PYTHON -m pylint /io/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring
172+
cd /io/tests
173+
$PYTHON -m pylint /io/opencv/samples/python/squares.py
173174
}
174175

175176
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'

0 commit comments

Comments
 (0)