refactor: Clean Architecture + SOLID - New decoders, comprehensive tests, and bilingual docs#59
Merged
Conversation
…sts, and docs Changes: - Fix namespace casing across all projects (ChunkDecoder, Entity, Tests) - Rename BaseEntity.cs to AbstractEntity.cs - Fix method naming: checkValidity -> CheckValidity - Make DecodedMetar and DecodedTaf constructors public (SOLID) - Add TrendChunkDecoder (NOSIG/BECMG/TEMPO) for METAR - Add RemarkChunkDecoder (RMK/SLP) for METAR - Add new properties to DecodedMetar: TrendType, TrendForecast, Remark, SeaLevelPressure - Update Metar.Decoder version to 1.0.9 - Update Taf.Decoder version to 1.0.7 - Add MetarDecoderComprehensiveTest with 50+ test cases - Add TrendChunkDecoderTest and RemarkChunkDecoderTest - Add TafDecoderComprehensiveTest with 45+ test cases - Add bilingual documentation (en-us and pt-br) for both libraries Co-Authored-By: Afonso Dutra Nogueira Filho <afonsoft@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Owner
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
| { | ||
| var result = decoder.Parse("RMK AO2 SLP013 T00720044 "); | ||
| var decoded = result[MetarDecoder.ResultKey] as Dictionary<string, object>; | ||
| ClassicAssert.IsTrue(decoded.ContainsKey(RemarkChunkDecoder.RemarkParameterName)); |
| { | ||
| var result = decoder.Parse("RMK AO2 SLP013 T00720044 "); | ||
| var decoded = result[MetarDecoder.ResultKey] as Dictionary<string, object>; | ||
| ClassicAssert.IsTrue(decoded.ContainsKey(RemarkChunkDecoder.SeaLevelPressureParameterName)); |
| { | ||
| var result = decoder.Parse("RMK SLP982 "); | ||
| var decoded = result[MetarDecoder.ResultKey] as Dictionary<string, object>; | ||
| var slp = (Value)decoded[RemarkChunkDecoder.SeaLevelPressureParameterName]; |
| { | ||
| var result = decoder.Parse("SOMETHING "); | ||
| var decoded = result[MetarDecoder.ResultKey] as Dictionary<string, object>; | ||
| ClassicAssert.IsFalse(decoded.ContainsKey(RemarkChunkDecoder.RemarkParameterName)); |
| { | ||
| var result = decoder.Parse("NOSIG "); | ||
| var decoded = result[MetarDecoder.ResultKey] as Dictionary<string, object>; | ||
| ClassicAssert.AreEqual("NOSIG", decoded[TrendChunkDecoder.TrendTypeParameterName]); |
| { | ||
| var result = decoder.Parse("BECMG 24010KT "); | ||
| var decoded = result[MetarDecoder.ResultKey] as Dictionary<string, object>; | ||
| ClassicAssert.AreEqual("BECMG", decoded[TrendChunkDecoder.TrendTypeParameterName]); |
| { | ||
| var result = decoder.Parse("TEMPO 3000 BR "); | ||
| var decoded = result[MetarDecoder.ResultKey] as Dictionary<string, object>; | ||
| ClassicAssert.AreEqual("TEMPO", decoded[TrendChunkDecoder.TrendTypeParameterName]); |
| { | ||
| var result = decoder.Parse("SOMETHING "); | ||
| var decoded = result[MetarDecoder.ResultKey] as Dictionary<string, object>; | ||
| ClassicAssert.IsFalse(decoded.ContainsKey(TrendChunkDecoder.TrendTypeParameterName)); |
| public void TestParseMetarWithWindShearAllRunways() | ||
| { | ||
| var d = decoder.ParseNotStrict("METAR LFPO 231027Z 24004KT 9999 FEW020 17/10 Q1009 WS ALL RWY "); | ||
| ClassicAssert.IsTrue(d.WindshearAllRunways.Value); |
afonsoft
approved these changes
May 4, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Reorganization of the codebase following Clean Architecture and SOLID principles, with new METAR decoders, comprehensive unit tests, version updates, and bilingual documentation.
All Submissions:
New Feature Submissions:
Changes to Core Features:
Changes
Namespace & Naming Fixes (Clean Architecture)
Taf.Decoder.chunkdecoder→Taf.Decoder.ChunkDecoderTaf.Decoder.entity→Taf.Decoder.EntityMetar.Decoder.Chunkdecoder→Metar.Decoder.ChunkDecoderMetar.Decoder_tests→Metar.Decoder.TestsTaf.Decoder_tests→Taf.Decoder.TestsBaseEntity.cs→AbstractEntity.cs(clearer naming)checkValidity()→CheckValidity()(C# convention)SOLID Improvements
DecodedMetarandDecodedTafconstructors public (testability, Dependency Inversion)entity.DecodedTaf.TafType→DecodedTaf.TafType)New METAR Decoders
DecodedMetarproperties:TrendType,TrendForecast,Remark,SeaLevelPressureVersion Updates
1.0.8→1.0.91.0.6→1.0.7Comprehensive Unit Tests
Bilingual Documentation
docs/en-us/MetarDecoder-Guide.md- English usage guidedocs/en-us/TafDecoder-Guide.md- English usage guidedocs/pt-br/MetarDecoder-Guia.md- Portuguese usage guidedocs/pt-br/TafDecoder-Guia.md- Portuguese usage guideEach guide includes: installation, quick start, all decoded fields with code examples, error handling, architecture overview, supported elements table, and glossary.
Test Results
311200Z CCCdatetime test (date-dependent, fails when current month has fewer than 31 days - not related to this PR)Link to Devin session: https://app.devin.ai/sessions/89ccd2ed34dc400a9604ec2988149399
Requested by: @afonsoft