From f02af0b047eb6107dde6670767293a6cccb09d54 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Wed, 27 Mar 2019 23:26:17 +0200 Subject: [PATCH] Fixing Codacity issues --- README.md | 8 +++----- pydsdl/_test.py | 1 - pydsdl/namespace.py | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4a20a39..23ad8e3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -PyDSDL -====== +# PyDSDL [![Travis CI](https://travis-ci.org/UAVCAN/pydsdl.svg?branch=master)](https://travis-ci.org/UAVCAN/pydsdl) [![Coverage Status](https://coveralls.io/repos/github/UAVCAN/pydsdl/badge.svg)](https://coveralls.io/github/UAVCAN/pydsdl) @@ -32,7 +31,6 @@ they need not be installed by the user): - [Parsimonious](https://github.com/erikrose/parsimonious) by Erik Rose, MIT license. - [Six](https://github.com/benjaminp/six) by Benjamin Peterson, MIT license; needed for Parsimonious. - ## Library API The library API is very simple, all of its entities are visible in `__init__.py`. @@ -92,9 +90,9 @@ response structure of the service type, respectively. Every data type (i.e., the `DataType` root class) has the following public attributes (although they raise `TypeError` when used against an instance of `ServiceType`): - - `bit_length_range: Tuple[int, int]` - returns a named tuple containing `min:int` and `max:int`, in bits, +- `bit_length_range: Tuple[int, int]` - returns a named tuple containing `min:int` and `max:int`, in bits, which represent the minimum and the maximum possible bit length of an encoded representation. - - `compute_bit_length_values() -> Set[int]` - this function performs a bit length combination analysis on +- `compute_bit_length_values() -> Set[int]` - this function performs a bit length combination analysis on the data type and returns a full set of bit lengths of all possible valid encoded representations of the data type. Due to the involved computations, the function can be expensive to invoke, so use with care. diff --git a/pydsdl/_test.py b/pydsdl/_test.py index bac5f67..4c9dd2f 100644 --- a/pydsdl/_test.py +++ b/pydsdl/_test.py @@ -713,7 +713,6 @@ def _define(rel_path: str, text: str) -> None: def _unittest_parse_namespace_versioning() -> None: from pytest import raises - import tempfile import glob directory = tempfile.TemporaryDirectory() diff --git a/pydsdl/namespace.py b/pydsdl/namespace.py index a773f9f..f34c6a4 100644 --- a/pydsdl/namespace.py +++ b/pydsdl/namespace.py @@ -223,7 +223,7 @@ def _ensure_minor_version_compatibility(types: typing.List[data_type.CompoundTyp for t in types: by_name[t.full_name].append(t) - for name, definitions in by_name.items(): + for definitions in by_name.values(): by_major = collections.defaultdict(list) # type: typing.DefaultDict[int, typing.List[data_type.CompoundType]] for t in definitions: by_major[t.version.major].append(t)