-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d6f79f
commit 9e808f4
Showing
17 changed files
with
465 additions
and
12 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
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 |
---|---|---|
|
@@ -86,7 +86,7 @@ eslint( | |
) | ||
|
||
test_suite( | ||
name = "test-unit", | ||
name = "test", | ||
tests = [ | ||
":audit", | ||
":lint", | ||
|
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 |
---|---|---|
|
@@ -81,7 +81,7 @@ eslint( | |
) | ||
|
||
test_suite( | ||
name = "test-unit", | ||
name = "test", | ||
tests = [ | ||
":audit", | ||
":lint", | ||
|
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 |
---|---|---|
|
@@ -86,7 +86,7 @@ eslint( | |
) | ||
|
||
test_suite( | ||
name = "test-unit", | ||
name = "test", | ||
tests = [ | ||
":audit", | ||
":lint", | ||
|
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
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
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 |
---|---|---|
|
@@ -201,7 +201,7 @@ jest_test( | |
) | ||
|
||
test_suite( | ||
name = "test-unit", | ||
name = "test", | ||
tests = [ | ||
":audit", | ||
":check-lint", | ||
|
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export_file( | ||
name = "clippy_output.py", | ||
visibility = ["PUBLIC"], | ||
) | ||
|
||
export_file( | ||
name = "crate_context.py", | ||
visibility = ["PUBLIC"], | ||
) | ||
|
||
export_file( | ||
name = "rustfmt_check.py", | ||
visibility = ["PUBLIC"], | ||
) |
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,35 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
Prints output of a Clippy compilation and exits non-zero if appropriate. | ||
""" | ||
import argparse | ||
import os | ||
import sys | ||
|
||
|
||
def parse_args() -> argparse.Namespace: | ||
parser = argparse.ArgumentParser(description=__doc__) | ||
parser.add_argument( | ||
"clippy_txt", | ||
help="The file from a Clippy compilation with its output") | ||
|
||
return parser.parse_args() | ||
|
||
|
||
def main() -> int: | ||
args = parse_args() | ||
|
||
# If output is empty, there are no errors/warnings and we can exit `0` | ||
if os.path.getsize(args.clippy_txt) == 0: | ||
return 0 | ||
|
||
# Otherwise print output and exit non-zero | ||
with open(args.clippy_txt, encoding="utf-8") as f: | ||
print(f.read()) | ||
|
||
return 1 | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
Builds an isolated tree containing all crate sources. | ||
""" | ||
import argparse | ||
import os | ||
import shutil | ||
import sys | ||
|
||
|
||
def parse_args() -> argparse.Namespace: | ||
parser = argparse.ArgumentParser(description=__doc__) | ||
parser.add_argument( | ||
"--src", | ||
action="append", | ||
help="Add a source into the source tree", | ||
) | ||
parser.add_argument( | ||
"out_path", | ||
help="Path to output directory", | ||
) | ||
|
||
return parser.parse_args() | ||
|
||
|
||
def main() -> int: | ||
args = parse_args() | ||
|
||
for src in args.src or []: | ||
parent_dir = os.path.dirname(src) | ||
if parent_dir: | ||
dst_dir = os.path.join(args.out_path, parent_dir) | ||
if not os.path.isdir(dst_dir): | ||
os.makedirs(dst_dir, exist_ok=True) | ||
abspath_src = os.path.abspath(src) | ||
if os.path.isdir(abspath_src): | ||
print("dir; src={}, dst={}".format( | ||
abspath_src, | ||
os.path.join(args.out_path, src), | ||
)) | ||
shutil.copytree( | ||
abspath_src, | ||
os.path.join(args.out_path, src), | ||
symlinks=True, | ||
dirs_exist_ok=True, | ||
) | ||
else: | ||
print("file; src={}, dst={}".format( | ||
abspath_src, | ||
os.path.join(args.out_path, src), | ||
)) | ||
shutil.copy( | ||
abspath_src, | ||
os.path.join(args.out_path, src), | ||
) | ||
|
||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) | ||
|
Oops, something went wrong.