meta: rename -meta.json to .meta.json
With `.meta.json` it's two "real" file extension. The `-meta.json` feels less clear.
This commit is contained in:
parent
16d30254c4
commit
3e11b57815
5 changed files with 9 additions and 10 deletions
10
.ruff.toml
10
.ruff.toml
|
|
@ -1,5 +1,10 @@
|
||||||
line-length = 120
|
line-length = 120
|
||||||
|
|
||||||
|
extend-exclude = [
|
||||||
|
"*.json",
|
||||||
|
]
|
||||||
|
force-exclude = true
|
||||||
|
|
||||||
[lint]
|
[lint]
|
||||||
# enabled the `isort` and `pylint` additional linters, see `ruff linter` output
|
# enabled the `isort` and `pylint` additional linters, see `ruff linter` output
|
||||||
# or: https://docs.astral.sh/ruff/rules/
|
# or: https://docs.astral.sh/ruff/rules/
|
||||||
|
|
@ -25,10 +30,5 @@ ignore = [
|
||||||
"PLW2901", # pylint: redefined loop variable
|
"PLW2901", # pylint: redefined loop variable
|
||||||
]
|
]
|
||||||
|
|
||||||
extend-exclude = [
|
|
||||||
"*.json",
|
|
||||||
]
|
|
||||||
force-exclude = true
|
|
||||||
|
|
||||||
[format]
|
[format]
|
||||||
quote-style = "preserve"
|
quote-style = "preserve"
|
||||||
|
|
|
||||||
|
|
@ -423,8 +423,7 @@ class ModuleInfo:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _load_from_json(cls, path, klass, name) -> Optional["ModuleInfo"]:
|
def _load_from_json(cls, path, klass, name) -> Optional["ModuleInfo"]:
|
||||||
# ideas welcome for a better filename/suffix :)
|
meta_json_suffix = ".meta.json"
|
||||||
meta_json_suffix = "-meta.json"
|
|
||||||
with open(path + meta_json_suffix, encoding="utf-8") as fp:
|
with open(path + meta_json_suffix, encoding="utf-8") as fp:
|
||||||
meta = json.load(fp)
|
meta = json.load(fp)
|
||||||
|
|
||||||
|
|
@ -618,7 +617,7 @@ class Index:
|
||||||
raise ValueError(f"Unsupported nodule class: {klass}")
|
raise ValueError(f"Unsupported nodule class: {klass}")
|
||||||
|
|
||||||
path = os.path.join(self.path, module_path)
|
path = os.path.join(self.path, module_path)
|
||||||
modules = filter(lambda f: os.path.isfile(f"{path}/{f}") and not path.endswith("-meta.json"),
|
modules = filter(lambda f: os.path.isfile(f"{path}/{f}") and not path.endswith(".meta.json"),
|
||||||
os.listdir(path))
|
os.listdir(path))
|
||||||
return list(modules)
|
return list(modules)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"""
|
"""
|
||||||
Do Nothing
|
Do Nothing
|
||||||
|
|
||||||
See "org.osbuild.noop-meta.json" for more details.
|
See "org.osbuild.noop.meta.json" for more details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ def test_schema():
|
||||||
|
|
||||||
|
|
||||||
def make_fake_meta_json(tmp_path, name):
|
def make_fake_meta_json(tmp_path, name):
|
||||||
meta_json_path = pathlib.Path(f"{tmp_path}/stages/{name}-meta.json")
|
meta_json_path = pathlib.Path(f"{tmp_path}/stages/{name}.meta.json")
|
||||||
meta_json_path.parent.mkdir(exist_ok=True)
|
meta_json_path.parent.mkdir(exist_ok=True)
|
||||||
meta_json_path.write_text("""
|
meta_json_path.write_text("""
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue