From 2e3ac3e286f40ac8031ab2048425174b5930a783 Mon Sep 17 00:00:00 2001 From: CrafterTA Date: Sun, 7 Dec 2025 22:34:16 +0700 Subject: [PATCH] chore: update changelog for version 0.2.0 and remove obsolete XML fix scripts --- CHANGELOG.md | 33 +++++++++++++++++++++- fix_xml_files.py | 62 ---------------------------------------- resolve_conflicts.py | 67 -------------------------------------------- 3 files changed, 32 insertions(+), 130 deletions(-) delete mode 100644 fix_xml_files.py delete mode 100644 resolve_conflicts.py diff --git a/CHANGELOG.md b/CHANGELOG.md index d2ab36b..48b4a0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,38 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.1.0] - 2025-12-06 +## [0.2.0] - 2025-12-07 + +### Added + +- **Development Tools**: + - Husky pre-commit hooks for automated code quality checks. + - Lint-staged configuration for efficient code formatting on commit. + - Prettier and ESLint integration for consistent code style. + +### Changed + +- **Documentation**: + - Added initial changelog for project tracking ([#47](https://github.com/sonmessia/GreenWave/pull/47)). + - Improved documentation structure and organization ([#51](https://github.com/sonmessia/GreenWave/pull/51)). + +### Fixed + +- **Frontend**: + - Fixed frontend Docker configuration for proper containerization. + - Resolved device management wizard issues ([#50](https://github.com/sonmessia/GreenWave/pull/50)). +- **SUMO Integration**: + - Fixed SUMO integration issues ([#52](https://github.com/sonmessia/GreenWave/pull/52)). + +### Contributors + +- [@sonmessia](https://github.com/sonmessia) +- [@CrafterTA](https://github.com/CrafterTA) +- [@HuynhTri-dev](https://github.com/HuynhTri-dev) + +**Full Changelog**: [v0.1.0...v0.2.0](https://github.com/sonmessia/GreenWave/compare/v0.1.0...v0.2.0) + +## [0.1.0] - 2025-12-06 ### Added diff --git a/fix_xml_files.py b/fix_xml_files.py deleted file mode 100644 index 321d124..0000000 --- a/fix_xml_files.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 -"""Fix XML files to have XML declaration at the beginning""" - -import os -import re -from pathlib import Path - -def fix_xml_file(filepath): - """Fix a single XML file""" - with open(filepath, 'r', encoding='utf-8') as f: - content = f.read() - - # Check if file starts with XML declaration - if content.strip().startswith('' - match = re.search(xml_decl_pattern, content) - - if not match: - print(f"āœ— {filepath.name} - No XML declaration found") - return False - - # Extract XML declaration - xml_decl = match.group(0) - - # Remove the XML declaration from its current position - content_without_decl = content.replace(xml_decl, '', 1) - - # Remove leading whitespace/newlines but keep copyright comments - content_without_decl = content_without_decl.lstrip('\n') - - # Put XML declaration at the beginning - new_content = xml_decl + '\n' + content_without_decl - - # Write back - with open(filepath, 'w', encoding='utf-8') as f: - f.write(new_content) - - print(f"āœ“ {filepath.name} - Fixed") - return True - -def main(): - # Path to Nga4ThuDuc directory - nga4_dir = Path('/home/thaianh/Study/GreenWave/src/backend/app/sumo_rl/sumo_files/Nga4ThuDuc') - - print("Fixing XML files in Nga4ThuDuc directory...\n") - - fixed_count = 0 - - # Fix all .xml and .sumocfg files - for pattern in ['*.xml', '*.sumocfg']: - for filepath in nga4_dir.glob(pattern): - if fix_xml_file(filepath): - fixed_count += 1 - - print(f"\nTotal files fixed: {fixed_count}") - -if __name__ == '__main__': - main() diff --git a/resolve_conflicts.py b/resolve_conflicts.py deleted file mode 100644 index fda4817..0000000 --- a/resolve_conflicts.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python3 -""" -Resolve Git merge conflicts in XML files -Keeps the HEAD version (current branch) and removes conflict markers -""" - -import os -import re -from pathlib import Path - -def resolve_conflict(content): - """ - Remove Git conflict markers and keep HEAD version - - Handles multiple patterns: - 1. <<<<<<< HEAD ... ======= ... >>>>>>> branch - 2. Standalone markers that weren't cleaned up - """ - # First pass: Remove complete conflict blocks, keep HEAD content - conflict_pattern = r'<<<<<<< HEAD\n(.*?)\n=======\n(.*?)\n>>>>>>> .*?\n' - resolved = re.sub( - conflict_pattern, - r'\1\n', - content, - flags=re.DOTALL - ) - - # Second pass: Remove any remaining standalone markers - resolved = re.sub(r'<<<<<<< HEAD\n?', '', resolved) - resolved = re.sub(r'=======\n?', '', resolved) - resolved = re.sub(r'>>>>>>> .*?\n?', '', resolved) - - return resolved - -def main(): - nga4_dir = Path('/home/thaianh/Study/GreenWave/src/backend/app/sumo_rl/sumo_files/Nga4ThuDuc') - - print("šŸ” Resolving Git merge conflicts in Nga4ThuDuc files...\n") - - fixed_count = 0 - - # Process all XML and sumocfg files - for pattern in ['*.xml', '*.sumocfg']: - for filepath in nga4_dir.glob(pattern): - with open(filepath, 'r', encoding='utf-8') as f: - content = f.read() - - # Check if file has conflicts - if '<<<<<<< HEAD' in content: - print(f"šŸ”§ Resolving {filepath.name}...") - - # Resolve conflicts - resolved_content = resolve_conflict(content) - - # Write back - with open(filepath, 'w', encoding='utf-8') as f: - f.write(resolved_content) - - fixed_count += 1 - print(f" āœ… Fixed") - else: - print(f" āœ“ {filepath.name} - No conflicts") - - print(f"\nāœ… Resolved conflicts in {fixed_count} files") - -if __name__ == '__main__': - main()