Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 5e38b45

Browse files
authored
[client] Sort imports with isort; add pre-commit hooks (#168)
* [client] Add black-compatible isort config * https://pycqa.github.io/isort/ * https://black.readthedocs.io/en/stable/compatible_configs.html#isort * [client] Sort all imports with isort * [client] Add isort to pre-commit hooks
1 parent 146db34 commit 5e38b45

25 files changed

+114
-103
lines changed

.isort.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[settings]
2+
multi_line_output = 3
3+
include_trailing_comma = True
4+
force_grid_wrap = 0
5+
use_parentheses = True
6+
ensure_newline_before_comments = True
7+
line_length = 88

.pre-commit-config.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 20.8b1
4-
hooks:
5-
- id: black
6-
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v3.3.0
8-
hooks:
9-
- id: check-yaml
1+
---
2+
repos:
3+
- repo: https://github.com/PyCQA/isort
4+
rev: 5.8.0
5+
hooks:
6+
- id: isort
7+
- repo: https://github.com/psf/black
8+
rev: 20.8b1
9+
hooks:
10+
- id: black
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v3.3.0
13+
hooks:
14+
- id: check-yaml

examples/add_external_reference_to_report.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# coding: utf-8
22

33
from dateutil.parser import parse
4+
45
from pycti import OpenCTIApiClient
56

67
# Variables

examples/cmd_line_tag_latest_indicators_of_threat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import argparse
33

44
from dateutil.parser import parse
5+
56
from pycti import OpenCTIApiClient
67

78
# Variables

examples/create_campaign_attributed-to_intrusion_set.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# coding: utf-8
22

33
from dateutil.parser import parse
4+
45
from pycti import OpenCTIApiClient
56

67
# Variables

examples/create_indicator_of_campaign.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# coding: utf-8
22

33
from dateutil.parser import parse
4+
45
from pycti import OpenCTIApiClient
56

67
# Variables

examples/create_intrusion_set.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# coding: utf-8
22

33
import datetime
4+
45
from pycti import OpenCTIApiClient
56

67
# Variables

examples/create_report_with_author.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# coding: utf-8
22

33
from dateutil.parser import parse
4+
45
from pycti import OpenCTIApiClient
56

67
# Variables

examples/export_incident_stix2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# coding: utf-8
22

33
import json
4+
45
from pycti import OpenCTIApiClient
56

67
# Variables

examples/export_incidents_stix2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# coding: utf-8
22

33
import json
4+
45
from pycti import OpenCTIApiClient
56

67
# Variables

0 commit comments

Comments
 (0)