Skip to content

Issue 425 - Migrate to DotNet 8 - File-scoped namespaces: Algorithms,… #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

gmottajr
Copy link
Contributor

Issue 425 - Migrate to DotNet 8 - File-scoped namespaces: Algorithms, Crypto, DataCompression, Encoders, Graph

Please let me know whether or not it would be necessary to create new unit tests for this change.

Motivation and Context
Github issue #425: Proposed to update to File-scoped namespaces. It was requested to perform the changes in a few PRs to make them smaller and easier to review. This is the one only meant to update .NET version.

  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Comments in areas I changed are up to date
  • I have added comments to hard-to-understand areas of my code
  • I have made corresponding changes to the README.md

@gmottajr gmottajr requested a review from siriak as a code owner December 29, 2023 20:55
Copy link

codecov bot commented Dec 29, 2023

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (821f492) 94.46% compared to head (5e0ca29) 94.49%.

Files Patch % Lines
Algorithms/Graph/BellmanFord.cs 92.00% 2 Missing and 2 partials ⚠️
Algorithms/Encoders/SoundexEncoder.cs 95.52% 0 Missing and 3 partials ⚠️
Algorithms/Graph/MinimumSpanningTree/PrimMatrix.cs 94.91% 2 Missing and 1 partial ⚠️
Algorithms/DataCompression/HuffmanCompressor.cs 97.43% 1 Missing and 1 partial ⚠️
Algorithms/Encoders/HillEncoder.cs 98.64% 0 Missing and 1 partial ⚠️
Algorithms/Encoders/NysiisEncoder.cs 99.05% 0 Missing and 1 partial ⚠️
Algorithms/Graph/BreadthFirstSearch.cs 94.11% 0 Missing and 1 partial ⚠️
Algorithms/Graph/DepthFirstSearch.cs 90.00% 0 Missing and 1 partial ⚠️
Algorithms/Graph/Dijkstra/DijkstraAlgorithm.cs 98.21% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #429      +/-   ##
==========================================
+ Coverage   94.46%   94.49%   +0.03%     
==========================================
  Files         234      234              
  Lines        9843     9843              
  Branches     1455     1455              
==========================================
+ Hits         9298     9301       +3     
+ Misses        384      381       -3     
  Partials      161      161              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit 231167f into TheAlgorithms:master Dec 29, 2023
@gmottajr
Copy link
Contributor Author

I'm concerning whether or not you would like a unit test for changes similar to this one. I can create them, just not sure if that is something that you think worth doing.
Another thing is related to the DotNet 8 upgrate, we could create a test that would check all project files associated to that solution if they are targeted to DotNet 8 or higher. This way I could require that any project that eventually gets added to that solution will be at least targeted .Net8. How does that sound?
Please let me know your thoughts.

@siriak
Copy link
Member

siriak commented Dec 31, 2023

@gmottajr, in general, it's a good idea to have architectural tests. But for targeting a version of .NET there are better ways. Firstly, we don't add new projects very often (we barely ever add them) and it's easy to see the version just by opening the project file. Secondly, we could add Directory.Build.props file to specify all versions in one place, but I think it would complicate the project for new developers who might be unfamiliar with it. Besides, we will need a new project just for these tests because they are neither algorithm tests nor data structures tests.

To sum up, I think we don't need such tests here because it would unnecessarily complicate the project for new developers.

@gmottajr
Copy link
Contributor Author

gmottajr commented Jan 2, 2024

Sure, that makes sense.
So never mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants