Skip to content

Commit bea0e62

Browse files
committed
Version upgrades
1 parent 777635c commit bea0e62

12 files changed

+1274
-1123
lines changed

.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compliance-io.iml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.mypy.ini

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[mypy-slugify.*]
2+
ignore_missing_imports = True

.pre-commit-config.yaml

+10-15
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
3-
exclude: ^CHANGELOG\.md$
43
repos:
54
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v3.4.0
5+
rev: v4.2.0
76
hooks:
87
- id: trailing-whitespace
98
- id: end-of-file-fixer
109
- id: check-yaml
11-
- id: check-added-large-files
12-
- repo: https://github.com/asottile/reorder_python_imports
13-
rev: v2.4.0
10+
- repo: https://github.com/pycqa/isort
11+
rev: 5.12.0
1412
hooks:
15-
- id: reorder-python-imports
16-
language_version: python3
13+
- id: isort
14+
name: isort (python)
15+
args: ["--profile", "black", "--filter-files"]
1716
- repo: https://github.com/psf/black
18-
rev: 20.8b1
17+
rev: 22.3.0
1918
hooks:
2019
- id: black
2120
language_version: python3
22-
- repo: https://gitlab.com/PyCQA/flake8
23-
rev: 3.8.4
21+
- repo: https://github.com/PyCQA/flake8
22+
rev: 3.9.2
2423
hooks:
2524
- id: flake8
2625
language_version: python3
27-
- repo: https://github.com/markdownlint/markdownlint
28-
rev: v0.11.0
29-
hooks:
30-
- id: markdownlint
3126
- repo: https://github.com/pre-commit/mirrors-mypy
32-
rev: v0.800
27+
rev: v0.950
3328
hooks:
3429
- id: mypy
3530
args: [--ignore-missing-imports]

complianceio/opencontrol.py

+8-11
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44
"""
55
from enum import Enum
66
from pathlib import Path
7-
from typing import Any
8-
from typing import Dict
9-
from typing import List
10-
from typing import Optional
11-
from typing import Set
7+
from typing import Any, Dict, List, Optional, Set
128

139
import rtyaml
1410
from blinker import signal
15-
from pydantic import BaseModel
16-
from pydantic import PrivateAttr
11+
from pydantic import BaseModel, PrivateAttr
1712
from slugify import slugify
1813

1914
OPENCONTROL_SCHEMA_VERSION = "1.0.0"
@@ -196,7 +191,7 @@ def load(cls, path: str, debug=True):
196191
return oc
197192

198193
def save(self):
199-
"Write back an OpenControl repo to where it was loaded"
194+
"""Write back an OpenControl repo to where it was loaded"""
200195
root_dir = self._root_dir
201196
root = self.dict(exclude={"standards", "components", "systems"})
202197
root["certifications"] = [
@@ -209,7 +204,7 @@ def save(self):
209204
print(rtyaml.dump(root))
210205

211206
def save_as(self, base_dir):
212-
"Save an OpenControl repo in a new location"
207+
"""Save an OpenControl repo in a new location"""
213208
root = self.dict(exclude={"standards", "components", "systems"})
214209
root["certifications"] = []
215210
for cert in self.certifications:
@@ -267,7 +262,8 @@ class OpenControlYaml(BaseModel):
267262
systems: Optional[List[str]]
268263
dependencies: Optional[Dict[str, List[Dependency]]]
269264

270-
def _component_path(self, component, relative_to):
265+
@staticmethod
266+
def _component_path(component, relative_to):
271267
path = relative_to / component
272268
if path.is_dir():
273269
path = path / "component.yaml"
@@ -300,7 +296,8 @@ def resolve_components(self, relative_to):
300296
raise Exception(msg)
301297
return resolved_components
302298

303-
def _is_fen(self, obj):
299+
@staticmethod
300+
def _is_fen(obj):
304301
satisfies = obj.get("satisfies", [])
305302
if isinstance(satisfies, list) and len(satisfies) > 0:
306303
return isinstance(satisfies[0], str)

0 commit comments

Comments
 (0)