Skip to content

Commit

Permalink
[fix] fix venv_dev and multiprocess lib usage
Browse files Browse the repository at this point in the history
Many functions and members of `multiprocess` lib are exposed
dynamically. For this reason pylint is not able to tell what
members this lib has (e.g. `multiprocess.Value()`. So these
pylint reports have been suppressed.

Another purpose of this commit is to make "superset" relationship
for venv_dev: if a CodeChecker developer installs venv_dev, then
the content of venv should always be installed. venv_dev just
extends them. `multiprocess` was a counterexample for this relationship:
it was installed only by `venv` and not `venv_dev`. Such a
mistake in the organization of requirements.txt files results
missing libraries for developers.
  • Loading branch information
bruntib committed Dec 4, 2023
1 parent 14ede03 commit 8ed48e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
14 changes: 0 additions & 14 deletions codechecker_common/skiplist_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ def should_skip(self, source):
return sign == '-'
return False

def __call__(self, source_file_path: str) -> bool:
"""
Check if the given source should be skipped.
"""
return self.should_skip(source_file_path)


class SkipListHandlers(list):
def should_skip(self, file_path: str):
Expand All @@ -117,11 +111,3 @@ def should_skip(self, file_path: str):
handler.
"""
return any(handler.should_skip(file_path) for handler in self)

# FIXME: eliminate this function and use should_skip instead of this.
# Do the same in the SkipListHandler class above.
def __call__(self, file_path: str) -> bool:
"""
Check if the given source should be skipped.
"""
return self.should_skip(file_path)
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
import logging
import os

from typing import Callable, Dict, List, Optional, Set
from typing import Callable, Dict, List, Optional, Protocol, Set

from .. import util


LOG = logging.getLogger('report-converter')


SkipListHandlers = Callable[[str], bool]
class SkipListHandlers(Protocol):
should_skip: Callable[[str], bool]


InvalidFileContentMsg: str = \
Expand Down Expand Up @@ -473,7 +474,7 @@ def skip(self, skip_handlers: Optional[SkipListHandlers]) -> bool:
if not skip_handlers:
return False

return skip_handlers(self.file.original_path)
return skip_handlers.should_skip(self.file.original_path)

def to_json(self) -> Dict:
""" Creates a JSON dictionary. """
Expand Down

0 comments on commit 8ed48e6

Please sign in to comment.