Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Commit

Permalink
Run pylint on clcachesrv.py during CI builds
Browse files Browse the repository at this point in the history
I needed to whitelist some Python packages using C code because pylint
refuses to load them (in order to inspect their exposed API) for
security reasons, so it ends up reporting that all used API is
undefined.

I couldn't tell why it wouldn't recognize pywintypes.OVERLAPPED()
though, and adding pywintypes to the whitelist wouldn't help - so I
resorted to just explicitly disabling that warning.
  • Loading branch information
Frerich Raabe committed Nov 18, 2016
1 parent 83fdbcc commit a333d16
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=
extension-pkg-whitelist=win32api,win32event,win32file,win32pipe

# Allow optimization of some AST trees. This will activate a peephole AST
# optimizer, which will apply various small optimizations. For instance, it can
Expand Down
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ install:
- pip install codecov
- coverage --version

# Install dependency needed for clcachesrv
- pip install pypiwin32

build_script:
- python clcache.py --help
- python clcache.py -s
- pylint --rcfile=.pylintrc clcache.py
- pylint --rcfile=.pylintrc clcachesrv.py
- pylint --rcfile=.pylintrc unittests.py
- pylint --rcfile=.pylintrc integrationtests.py
- pylint --rcfile=.pylintrc performancetests.py
Expand Down
4 changes: 2 additions & 2 deletions clcachesrv.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, path):
self.readBuffer = win32file.AllocateReadBuffer(8192)
self.cachedHashes = {}

self.overlapped = pywintypes.OVERLAPPED()
self.overlapped = pywintypes.OVERLAPPED() # pylint: disable=no-member
self.overlapped.hEvent = self.eventHandle
self.listen()

Expand Down Expand Up @@ -109,7 +109,7 @@ def __init__(self, path):
print("CreateNamedPipe failed for {name}: {error}".format(name=path, error=win32api.GetLastError()))
sys.exit(1)

self._overlapped = pywintypes.OVERLAPPED()
self._overlapped = pywintypes.OVERLAPPED() # pylint: disable=no-member
self._overlapped.hEvent = win32event.CreateEvent(None, True, 0, None)
self.event = self._overlapped.hEvent

Expand Down

0 comments on commit a333d16

Please sign in to comment.