File size: 1,151 Bytes
e49d8aa be07e2e e49d8aa |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# app.py
# Import necessary modules from lib
from lib.code_reviewer import CodeReviewer, ReviewManager
import os
def main():
# Directory structure setup
# Directory for storing input Ansible files
input_directory = "input_files"
# Directory for storing output JSON reviews
output_directory = "output_reviews"
# Ensure the directories exist
os.makedirs(input_directory, exist_ok=True)
os.makedirs(output_directory, exist_ok=True)
# Paths for testing
sample_files = [os.path.join(input_directory, "example1.yml"), os.path.join(input_directory, "example2.yml")]
output_json_path = os.path.join(output_directory, "code_review_results.json")
# Initialize the code reviewer and review manager
code_reviewer = CodeReviewer()
review_manager = ReviewManager(reviewer=code_reviewer)
# Process files and generate reviews
reviews = review_manager.process_files(sample_files)
# Save reviews to JSON
review_manager.save_reviews_to_json(reviews, output_json_path)
print(f"Reviews saved to {output_json_path}")
if __name__ == "__main__":
main()
|