-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidated validators to .tools/validation, and reworked file walker
- Loading branch information
1 parent
1dfecb3
commit 264c286
Showing
9 changed files
with
129 additions
and
85 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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
File renamed without changes.
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,44 @@ | ||
import argparse | ||
from pathlib import Path | ||
from sys import exit | ||
from metadata_validator import validate_all | ||
from project_validator import check_files, verify_sample_files | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--quiet", | ||
action="store_true", | ||
help="Suppresses output of filenames while parsing. " "The default is False.", | ||
) | ||
parser.add_argument( | ||
"--root", | ||
default=f"{Path(__file__).parent / '..' / '..'}", | ||
help="The root path from which to search for files " | ||
"to check. The default is the current working " | ||
"folder.", | ||
) | ||
parser.add_argument( | ||
"--doc-gen", | ||
default=f"{Path(__file__).parent / '..' / '..' / '.doc_gen'}", | ||
help="The folder that contains schema and metadata files.", | ||
required=False, | ||
) | ||
args = parser.parse_args() | ||
root_path = Path(args.root).resolve() | ||
|
||
error_count = check_files(root_path) | ||
error_count += verify_sample_files(root_path) | ||
error_count += validate_all(Path(args.doc_gen)) | ||
|
||
if error_count > 0: | ||
print(f"{error_count} errors found, please fix them.") | ||
else: | ||
print("All checks passed, you are cleared to check in.") | ||
|
||
return error_count | ||
|
||
|
||
if __name__ == "__main__": | ||
exit(main()) |
File renamed without changes.