Skip to content

Commit

Permalink
update CI linting config (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski committed Aug 30, 2018
1 parent 2596e69 commit caefb85
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 13 deletions.
33 changes: 24 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,29 @@ jobs:
key: v1-test-{{ checksum "requirements.txt" }}-{{ checksum "tox.ini" }}
paths:
- .tox/py36
- store_artifacts:
path: ./results
- store_test_results:
path: ./results/pytest
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Build Docker Image
command: make docker

# lint
#
# This job runs linting on project source files.
lint:
<<: *defaults
steps:
- checkout
- run:
name: Install Dependencies
command: |
sudo chown -R circleci:circleci /usr/local/bin
sudo chown -R circleci:circleci /usr/local/lib/python3.6/site-packages
pip install tox>=2.9.0
- restore_cache:
keys:
- v1-lint-{{ checksum "requirements.txt" }}-{{ checksum "tox.ini" }}
Expand All @@ -62,15 +85,6 @@ jobs:
key: v1-lint-{{ checksum "requirements.txt" }}-{{ checksum "tox.ini" }}
paths:
- .tox/lint
- store_artifacts:
path: ./results
- store_test_results:
path: ./results/pytest
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Build Docker Image
command: make docker

# publish-edge
#
Expand Down Expand Up @@ -197,6 +211,7 @@ workflows:
build:
jobs:
- test
- lint
- publish-edge:
context: vapor-auto
requires:
Expand Down
10 changes: 8 additions & 2 deletions synse/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,10 @@ async def _build_capabilities_cache():
# Track which plugins failed to provide capability info for any reason.
failures = {}

async for plugin_id, plugin in get_plugins():
# FIXME (etd): as of pylint 2.1.1, this gets marked with 'not-an-iterable'
# It still appears to work just fine, so need to figure out why it is getting
# marked as such and what should be done to fix it.
async for plugin_id, plugin in get_plugins(): # pylint: disable=not-an-iterable
logger.debug('{} - {}'.format(plugin_id, plugin))

devices = []
Expand Down Expand Up @@ -448,7 +451,10 @@ async def _build_device_info_cache():
# Track which plugins failed to provide devices for any reason.
failures = {}

async for plugin_id, plugin in get_plugins():
# FIXME (etd): as of pylint 2.1.1, this gets marked with 'not-an-iterable'
# It still appears to work just fine, so need to figure out why it is getting
# marked as such and what should be done to fix it.
async for plugin_id, plugin in get_plugins(): # pylint: disable=not-an-iterable
logger.debug('{} -- {}'.format(plugin_id, plugin))

try:
Expand Down
6 changes: 5 additions & 1 deletion synse/commands/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ async def get_plugins():
# - metadata (grpc metadata) .. we need to make a call for this
# - health (grpc health) .. we need to make a call for this
plugins = []
async for p in plugin.get_plugins():

# FIXME (etd): as of pylint 2.1.1, this gets marked with 'not-an-iterable'
# It still appears to work just fine, so need to figure out why it is getting
# marked as such and what should be done to fix it.
async for p in plugin.get_plugins(): # pylint: disable=not-an-iterable
_plugin = p[1]
# Get the plugin config and add it to the plugin data
plugin_data = {
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the 'synse.errors' Synse Server module."""
# pylint: disable=unsubscriptable-object

from sanic import exceptions

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ basepython=
python3.6
commands=
isort synse tests -rc -c --diff
pylint --load-plugins pylint_quotes synse tests
pylint -j 2 --load-plugins pylint_quotes synse tests


[i18n]
Expand Down

0 comments on commit caefb85

Please sign in to comment.