Skip to content

Commit c7cf8c0

Browse files
committed
refactor: improve pylint score a little
1 parent 81e5226 commit c7cf8c0

File tree

15 files changed

+47
-38
lines changed

15 files changed

+47
-38
lines changed

_appmap/django.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from . import remote_recording
1313

1414

15-
class RemoteRecording: # pylint: disable=missing-class-docstring
15+
class RemoteRecording: # pylint: disable=missing-class-docstring,too-few-public-methods
1616
def __init__(self, get_response):
1717
super().__init__()
1818
self.get_response = get_response

_appmap/event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def to_dict(self, attrs=None):
329329
return ret
330330

331331

332-
class SqlEvent(Event):
332+
class SqlEvent(Event): # pylint: disable=too-few-public-methods
333333
__slots__ = ["sql_query"]
334334

335335
def __init__(self, sql, vendor=None, version=None):
@@ -345,7 +345,7 @@ def __init__(self, sql, vendor=None, version=None):
345345
)
346346

347347

348-
class MessageEvent(Event):
348+
class MessageEvent(Event): # pylint: disable=too-few-public-methods
349349
__slots__ = ["message"]
350350

351351
def __init__(self, message_parameters):

_appmap/generation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def values(self):
1919
return self._dict.values()
2020

2121

22-
class ClassMapEntry:
22+
class ClassMapEntry: # pylint: disable=too-few-public-methods
2323
# pylint: disable=redefined-builtin
2424
def __init__(self, name, type):
2525
self.name = name
@@ -32,19 +32,19 @@ def to_dict(self):
3232
return {k: v for k, v in vars(self).items() if v is not None}
3333

3434

35-
class PackageEntry(ClassMapEntry):
35+
class PackageEntry(ClassMapEntry): # pylint: disable=too-few-public-methods
3636
def __init__(self, name):
3737
super().__init__(name, "package")
3838
self.children = ClassMapDict()
3939

4040

41-
class ClassEntry(ClassMapEntry):
41+
class ClassEntry(ClassMapEntry): # pylint: disable=too-few-public-methods
4242
def __init__(self, name):
4343
super().__init__(name, "class")
4444
self.children = ClassMapDict()
4545

4646

47-
class FuncEntry(ClassMapEntry):
47+
class FuncEntry(ClassMapEntry): # pylint: disable=too-few-public-methods
4848
def __init__(self, e):
4949
super().__init__(e.method_id, "function")
5050
self.location = "%s:%s" % (e.path, e.lineno)

_appmap/importer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def fntype(self):
6262
return self.scope.classify_fn(self.static_fn)
6363

6464

65-
class Filter(ABC):
65+
class Filter(ABC): # pylint: disable=too-few-public-methods
6666
def __init__(self, next_filter):
6767
self.next_filter = next_filter
6868

@@ -75,7 +75,7 @@ def filter(self, filterable):
7575
"""
7676

7777

78-
class NullFilter(Filter):
78+
class NullFilter(Filter): # pylint: disable=too-few-public-methods
7979
def __init__(self, next_filter=None):
8080
super().__init__(next_filter)
8181

_appmap/labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
logger = Env.current.getLogger(__name__)
88

99

10-
class labels:
10+
class labels: # pylint: disable=too-few-public-methods
1111
def __init__(self, *args):
1212
self._labels = args
1313

_appmap/noappmap.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import sys
2-
31
_appmap_noappmap = "_appmap_noappmap"
42

53

_appmap/recording.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import atexit
2-
import datetime
2+
from datetime import datetime, timezone
33
import os
44
from tempfile import NamedTemporaryFile
55

@@ -74,7 +74,7 @@ def write_appmap(
7474
with NamedTemporaryFile(mode="w", dir=basedir, delete=False) as tmp:
7575
tmp.write(generation.dump(appmap, metadata))
7676
appmap_file = basedir / filename
77-
logger.info("info, writing %s", appmap_file)
77+
logger.info("writing %s", appmap_file)
7878
os.replace(tmp.name, appmap_file)
7979

8080

@@ -86,14 +86,15 @@ def initialize():
8686
def save_at_exit():
8787
nonlocal r
8888
r.stop()
89-
appmap_name = datetime.utcnow().isoformat(timespec='seconds') + "Z"
89+
now = datetime.now(timezone.utc)
90+
appmap_name = now.isoformat(timespec="seconds").replace("+00:00", "Z")
9091
recorder_type = "process"
9192
metadata = {
9293
"name": appmap_name,
9394
"recorder": {
9495
"name": "process",
9596
"type": recorder_type,
96-
}
97+
},
9798
}
9899
write_appmap(r, appmap_name, recorder_type, metadata)
99100

_appmap/test/data/trial/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
_trial_temp/
2-
tmp/

_appmap/test/data/unittest/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

_appmap/test/test_test_frameworks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def test_pytest_trial(self, testdir):
125125
RECORDER_TYPE = "test"
126126

127127

128-
@pytest.fixture
129-
def recorder_outdir(tmp_path) -> Path:
128+
@pytest.fixture(name="recorder_outdir")
129+
def _recorder_outdir(tmp_path) -> Path:
130130
ret = tmp_path / RECORDER_TYPE
131131
ret.mkdir(parents=True)
132132
return ret

0 commit comments

Comments
 (0)