BirjuVachhani / spider

A small dart library to generate Assets dart code from assets folder.
https://spider.birju.dev/
Apache License 2.0
190 stars 19 forks source link

Sort generated file maps by file basenames #45

Closed WSydnA closed 2 years ago

WSydnA commented 2 years ago

Description of the Change

This change adds basic sorting to the contents of generated file maps (which appear in assets libraries and tests). This is nice to have to ensure each time Spider builds, it creates lists of files in the same order every time.

I need this because in my project we would like to run spider build in CI to make sure the developer has regenerated all assets. We use git diff to make sure the assets are synced correctly, and without sorting we get a lot of false errors.

Alternate Designs

This is the simplest change I could think of.

Why Should This Be In Core?

It's a small change which adds consistency and predictability for users of the package.

Benefits

Consistency, predictability, ability to use reliably within CI pipelines.

Possible Drawbacks

No long-term drawbacks that I can think of. Users moving to a version including this change might see a bit more noise in git diff the next time they run the spider build command.

Verification Process

Applicable Issues

N/A - happy to create one if needed.

Thanks for the useful project!

codecov-commenter commented 2 years ago

Codecov Report

Merging #45 (308747a) into main (467e8e5) will increase coverage by 0.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
+ Coverage   86.42%   86.46%   +0.03%     
==========================================
  Files          11       11              
  Lines         361      362       +1     
==========================================
+ Hits          312      313       +1     
  Misses         49       49              
Impacted Files Coverage Δ
lib/src/dart_class_generator.dart 94.40% <100.00%> (+0.04%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 14de2ba...308747a. Read the comment docs.

BirjuVachhani commented 2 years ago

@WSydnA Thank you for your contribution. I'll release this soon. 😊

BirjuVachhani commented 2 years ago

@WSydnA This has been released in v2.2.2

WSydnA commented 2 years ago

@BirjuVachhani Thank you!