eliminates the build commits and merge commits

mail@pastecode.io avatar
unknown
python
14 days ago
576 B
3
Indexable
Never
import json

# Define the input and output file paths
input_file = 'commits.json'
output_file = 'commits-filter.json'

# Read data from input file
with open(input_file, 'r') as f:
    data = json.load(f)

# Filter out objects with specific messages
filtered_data = [commit for commit in data if not any(
    keyword in commit['message'].lower() for keyword in ['dev build', 'merge branch'])]

# Write filtered data to output file
with open(output_file, 'w') as f:
    json.dump(filtered_data, f, indent=2)

print(f"Filtered commits saved to {output_file}")
Leave a Comment