-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify translations are compiled in the CI
Avoids manually running compilemessages locally to check if the compiled message files are up to date. Reviewed-by: thedrow Reviewed-by: stefanfoulis
- Loading branch information
1 parent
bcd0608
commit e653a09
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
exclude .gitignore | ||
exclude check-translations | ||
exclude sonar-project.properties | ||
prune .github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import subprocess | ||
import sys | ||
|
||
import django | ||
from django.core.management import call_command | ||
|
||
|
||
def main(): | ||
kwargs = {} if django.VERSION < (3,) else {"ignore": ".tox"} | ||
with open(os.devnull, "w") as devnull: | ||
call_command("compilemessages", **kwargs, stdout=devnull) | ||
|
||
result = subprocess.run( | ||
["git", "status", "--porcelain"], | ||
check=True, | ||
stdout=subprocess.PIPE, | ||
) | ||
stdout = result.stdout.decode() | ||
if stdout != "": | ||
print( | ||
f"Unexpected changes found in the workspace:\n\n{stdout}", | ||
file=sys.stderr, | ||
) | ||
sys.exit(1) | ||
assert result.stderr is None | ||
|
||
|
||
if __name__ == "__main__": | ||
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings" | ||
django.setup() | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters