Skip to content

Commit 6a98e8b

Browse files
authored
Fix pylint errors (#614)
* Fix pylint errors * add new pylintrc * change pylintrc names * add some pylint ignore flags * fix more pylint errors * fix pylint errors part 2 * fix pylint part 3 * fix pylint part 4 * update pylintrc * update pylintrc * enable pylintrx * pylit fix part 5 * pylint fixes part 6 * pylint fixes part 7 * pylint fixes part 8 * pylint fixes part 9 * license headers fix * license headers update * pylint fix * add new line to end of pylintrc
1 parent 96e83f2 commit 6a98e8b

38 files changed

+105
-80
lines changed

.github/actions/common/pylint/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ runs:
4646
echo "📝 Found Python files, running pylint..."
4747
# Save full output to temporary file first
4848
temp_output="${output_file}.full"
49-
find "${path}" -name "*.py" -not -path "*/venv/*" -print0 | xargs -0 pylint 2>&1 | tee "${temp_output}" || true
49+
find "${path}" -name "*.py" -not -path "*/venv/*" -print0 | xargs -0 pylint --rcfile="${path}/pylintrc" 2>&1 | tee "${temp_output}" || true
5050
# Filter only errors (E) and fatal (F) issues to the main output file
5151
if [ -f "${temp_output}" ]; then
5252
# Extract errors and fatal issues

docs/scripts/generate_elements_page.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ==============================================================================
2-
# Copyright (C) 2023 Intel Corporation
2+
# Copyright (C) 2023-2026 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
# ==============================================================================
@@ -15,7 +15,8 @@
1515
import sys
1616
import gi
1717
gi.require_version('Gst', '1.0')
18-
from gi.repository import Gst
18+
gi.require_version('GLib', '2.0')
19+
from gi.repository import Gst, GLib # pylint: disable=no-name-in-module, wrong-import-position
1920

2021
import inspect
2122

pylintrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[MAIN]
2+
source-roots = python/gstgva
3+
4+
[MESSAGES CONTROL]
5+
6+
# E0401 = Unable to import module
7+
disable=E0401
8+
9+
[FORMAT]
10+
max-line-length=160

python/gstgva/audio/audio_event.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ==============================================================================
2-
# Copyright (C) 2018-2021 Intel Corporation
2+
# Copyright (C) 2018-2026 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
# ==============================================================================
@@ -8,7 +8,6 @@
88
# @brief This file contains gstgva.audio_event.AudioEvent class to control audio events for particular gstgva.audio_frame.AudioFrame with gstgva.tensor.Tensor instances attached
99

1010
import ctypes
11-
import numpy
1211
from typing import List
1312
from collections import namedtuple
1413

@@ -20,7 +19,9 @@
2019
gi.require_version('GstAudio', '1.0')
2120
gi.require_version('GLib', '2.0')
2221
gi.require_version('Gst', '1.0')
22+
# pylint: disable=no-name-in-module
2323
from gi.repository import GstAudio, GLib, GObject, Gst
24+
# pylint: enable=no-name-in-module
2425

2526
Segment = namedtuple("Segment", "start_time end_time")
2627

python/gstgva/audio/audio_frame.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ==============================================================================
2-
# Copyright (C) 2018-2021 Intel Corporation
2+
# Copyright (C) 2018-2026 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
# ==============================================================================
@@ -19,7 +19,9 @@
1919
gi.require_version("GstAudio", "1.0")
2020
gi.require_version('GObject', '2.0')
2121

22+
# pylint: disable=no-name-in-module
2223
from gi.repository import GObject, Gst, GstAudio
24+
# pylint: enable=no-name-in-module
2325
from .audio_event_meta import AudioEventMeta
2426
from .audio_event import AudioEvent
2527
from ..util import GVATensorMeta

python/gstgva/tensor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
gi.require_version("GstAnalytics", "1.0")
1717

1818
from enum import Enum
19+
# pylint: disable=no-name-in-module
1920
from gi.repository import GObject, GstAnalytics, GLib
21+
# pylint: enable=no-name-in-module
2022
from .util import (
2123
libgst,
2224
libgobject,

python/gstgva/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
gi.require_version('GstVideo', '1.0')
1313
gi.require_version('GstAudio', '1.0')
1414
gi.require_version('Gst', '1.0')
15+
# pylint: disable=no-name-in-module
1516
from gi.repository import GstVideo, GstAudio, GObject, Gst
17+
# pylint: enable=no-name-in-module
1618

1719
# libgstreamer
1820
if platform.system() == 'Windows':

python/gstgva/video_frame.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
gi.require_version("GstAnalytics", "1.0")
2424
gi.require_version("GLib", "2.0")
2525

26+
# pylint: disable=no-name-in-module
2627
from gi.repository import Gst, GstVideo, GstAnalytics, GLib
28+
# pylint: enable=no-name-in-module
2729
from .util import VideoRegionOfInterestMeta
2830
from .util import GVATensorMeta
2931
from .util import GVAJSONMeta

samples/gstreamer/gst_launch/gvapython/face_detection_and_classification/postproc_callbacks/ssd_object_detection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# ==============================================================================
2-
# Copyright (C) 2018-2021 Intel Corporation
2+
# Copyright (C) 2018-2026 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
# ==============================================================================
66

77
import sys
88
import gi
99
gi.require_version('Gst', '1.0')
10-
from gi.repository import Gst, GObject
10+
from gi.repository import Gst, GObject # pylint: disable=no-name-in-module, wrong-import-position
1111

1212
from gstgva import VideoFrame
1313

samples/gstreamer/python/draw_face_attributes/draw_face_attributes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ==============================================================================
2-
# Copyright (C) 2018-2025 Intel Corporation
2+
# Copyright (C) 2018-2026 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
# ==============================================================================
@@ -16,7 +16,7 @@
1616
gi.require_version('Gst', '1.0')
1717
gi.require_version('GstApp', '1.0')
1818
gi.require_version('GstVideo', '1.0')
19-
from gi.repository import Gst, GLib, GstApp, GstVideo
19+
from gi.repository import Gst, GLib, GstApp, GstVideo # pylint: disable=no-name-in-module, wrong-import-position
2020

2121
parser = ArgumentParser(add_help=False)
2222
_args = parser.add_argument_group('Options')

0 commit comments

Comments
 (0)