Skip to content

Commit 03aac84

Browse files
authored
Merge pull request #128 from Pennycook/remove-unused-utils
Remove unused functions from util.py
2 parents 31ee6e3 + 2ce5fcd commit 03aac84

File tree

1 file changed

+0
-64
lines changed

1 file changed

+0
-64
lines changed

codebasin/util.py

-64
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import pkgutil
1414
import tomllib
1515
import typing
16-
import warnings
1716
from collections.abc import Iterable
1817
from os.path import splitext
1918

@@ -36,35 +35,6 @@ def ensure_png(fname):
3635
return ensure_ext(fname, ".png")
3736

3837

39-
def ensure_source(fname):
40-
"""Return true if the path passed in specifies a source file"""
41-
extensions = [
42-
".s",
43-
".asm",
44-
".c",
45-
".cpp",
46-
".cxx",
47-
".c++",
48-
".cc",
49-
".h",
50-
".hpp",
51-
".hxx",
52-
".h++",
53-
".hh",
54-
".inc",
55-
".inl",
56-
".tcc",
57-
".icc",
58-
".ipp",
59-
]
60-
return ensure_ext(fname, extensions)
61-
62-
63-
def ensure_json(fname):
64-
"""Return true if the path passed in specifies a JSON file"""
65-
return ensure_ext(fname, ".json")
66-
67-
6838
def safe_open_write_binary(fname):
6939
"""Open fname for (binary) writing. Truncate if not a symlink."""
7040
fpid = os.open(
@@ -235,37 +205,3 @@ def _load_toml(file_object: typing.TextIO, schema_name: str) -> object:
235205
toml_object = tomllib.load(file_object)
236206
_validate_json(toml_object, schema_name)
237207
return toml_object
238-
239-
240-
def validate_coverage_json(json_string: str) -> bool:
241-
"""
242-
Validate coverage JSON string against schema.
243-
244-
Parameters
245-
----------
246-
json_string : String
247-
The JSON string to validate.
248-
249-
Returns
250-
-------
251-
bool
252-
True if the JSON string is valid.
253-
254-
Raises
255-
------
256-
ValueError
257-
If the JSON string fails to validate.
258-
259-
TypeError
260-
If the JSON string is not a string.
261-
"""
262-
warnings.warn(
263-
"Direct access to JSON validation is deprecated.",
264-
DeprecationWarning,
265-
)
266-
267-
if not isinstance(json_string, str):
268-
raise TypeError("Coverage must be a JSON string.")
269-
270-
instance = json.loads(json_string)
271-
return _validate_json(instance, "coverage")

0 commit comments

Comments
 (0)