Skip to content

Commit

Permalink
Revised bandit exclusion comments (#904)
Browse files Browse the repository at this point in the history
<!-- Contributing guide:
https://github.com/openvinotoolkit/datumaro/blob/develop/CONTRIBUTING.md
-->

### Summary
Revised some comments for excluding to the report of bandit.

<!--
Resolves #111 and #222.
Depends on #1000 (for series of dependent commits).

This PR introduces this capability to make the project better in this
and that.

- Added this feature
- Removed that feature
- Fixed the problem #1234
-->

### How to test
<!-- Describe the testing procedure for reviewers, if changes are
not fully covered by unit tests or manual testing can be complicated.
-->

### Checklist
<!-- Put an 'x' in all the boxes that apply -->
- [ ] I have added unit tests to cover my changes.​
- [ ] I have added integration tests to cover my changes.​
- [ ] I have added the description of my changes into
[CHANGELOG](https://github.com/openvinotoolkit/datumaro/blob/develop/CHANGELOG.md).​
- [ ] I have updated the
[documentation](https://github.com/openvinotoolkit/datumaro/tree/develop/docs)
accordingly

### License

- [ ] I submit _my code changes_ under the same [MIT
License](https://github.com/openvinotoolkit/datumaro/blob/develop/LICENSE)
that covers the project.
  Feel free to contact the maintainers if that's a concern.
- [ ] I have updated the license header for each file (see an example
below).

```python
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
```
  • Loading branch information
yunchu authored Apr 10, 2023
1 parent af7c07c commit fd5aa10
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion datumaro/components/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging as log

# Disable B410: import_lxml - the library is used for writing
from lxml import etree as ET # nosec, lxml has proper XPath implementation
from lxml import etree as ET # nosec

from datumaro.components.annotation import (
Annotation,
Expand Down
2 changes: 1 addition & 1 deletion datumaro/components/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ def _parse_ref(self, ref: Union[None, Revision, ObjectId]) -> Tuple[_ObjectIdKin

try:
obj_type, obj_hash = self._git.rev_parse(ref)
except Exception: # nosec - B110:try_except_pass
except Exception: # nosec try_except_pass
pass # Ignore git errors
else:
if obj_type != "commit":
Expand Down
2 changes: 1 addition & 1 deletion datumaro/plugins/data_formats/cifar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import os
import os.path as osp
import pickle # nosec - disable B403:import_pickle check - fixed
import pickle # nosec import_pickle
from collections import OrderedDict
from typing import Any, Dict, List, Optional

Expand Down
2 changes: 1 addition & 1 deletion datumaro/util/pickle_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: MIT

import pickle # nosec - disable B403:import_pickle check - fixed
import pickle # nosec import_pickle

import numpy.core.multiarray

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_cifar_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import os
import os.path as osp
import pickle # nosec - disable B403:import_pickle check
import pickle # nosec import_pickle
import shutil
from unittest import TestCase

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_coco_format.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import os.path as osp
import pickle # nosec - disable B403:import_pickle check
import pickle # nosec import_pickle
import shutil
from copy import deepcopy
from functools import partial
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_dataset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import os.path as osp
import pickle # nosec - disable B403:import_pickle check
import pickle # nosec import_pickle
from unittest import TestCase, mock

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_imagenet_format.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pickle # nosec - disable B403:import_pickle check
import pickle # nosec import_pickle
from unittest import TestCase

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_voc_format.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import os.path as osp
import pickle # nosec - disable B403:import_pickle check
import pickle # nosec import_pickle
from collections import OrderedDict
from functools import partial
from unittest import TestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_yolo_format.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import os.path as osp
import pickle # nosec - disable B403:import_pickle check
import pickle # nosec import_pickle
from unittest import TestCase

import numpy as np
Expand Down

0 comments on commit fd5aa10

Please sign in to comment.