Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change check to fail on sound file not ogg #49

Merged
merged 2 commits into from
Jul 19, 2022
Merged

Change check to fail on sound file not ogg #49

merged 2 commits into from
Jul 19, 2022

Conversation

Fris0uman
Copy link
Owner

@Fris0uman Fris0uman commented Jul 19, 2022

Part of #29

Change the python script slightly so that it fails if the added sound files are not .ogg

tests failed where expected in #50

@dseguin
Copy link
Contributor

dseguin commented Jul 19, 2022

Sorry, I just realized that I missed a key piece of functionality here:

diff --git a/tools/validate_unreferenced_sndfile.py b/tools/validate_unreferenced_sndfile.py
index 609b42e..e96a6e3 100755
--- a/tools/validate_unreferenced_sndfile.py
+++ b/tools/validate_unreferenced_sndfile.py
@@ -11,6 +11,13 @@ args.add_argument("fmt", action="store", help="escapes output if set to GHA")
 args_dict = vars(args.parse_args())
 
 
+txt_exts = {
+    ".json",
+    ".txt",
+    ".md"
+}
+
+
 def gha_escape(msg: str) -> str:
     msg = msg.replace("%", "%25")
     msg = msg.replace("\r", "%0D")
@@ -105,6 +112,11 @@ for root, dirs, filenames in os.walk(args_dict["dir"]):
                 retval = 1
             if not check_credits(shortpath):
                 retval = 1
+        elif ext[1].lower() not in txt_exts:
+            printout("Unrecognized file extension \"{}\" for file \"{}\".  "
+                     "Sound files expected in OGG format."
+                     .format(ext[1], filename), 2)
+            retval = 1
 
 if at_least_one == False:
     printout("No sound files processed", 2)

Without this, non-ogg files will be silently ignored

Co-authored-by: David Seguin <dseguin@users.noreply.github.com>
@Fris0uman Fris0uman marked this pull request as ready for review July 19, 2022 16:04
@Fris0uman Fris0uman merged commit 31c64b7 into main Jul 19, 2022
@Fris0uman Fris0uman deleted the only_ogg branch July 19, 2022 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants