Skip to content

Conversation

KaranChadha10
Copy link
Contributor

Summary of the change

This pull request contains the following changes

  • Converted block-scoped namespaces to file-scoped namespaces for consistency
  • Removed redundant/unused global using directives to improve code clarity
  • Aligned code formatting with project conventions and C# 10+ style guidelines

Issue link: #520

  • 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

@siriak siriak requested a review from Copilot September 7, 2025 08:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request modernizes the C# codebase by migrating from block-scoped to file-scoped namespaces and removing unused global using statements to align with C# 10+ conventions and improve code clarity.

  • Converts all block-scoped namespaces (namespace X { }) to file-scoped namespaces (namespace X;)
  • Removes unused global using directives across multiple files
  • Updates code formatting to follow modern C# style guidelines

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
DataStructures/Hashing/NumberTheory/PrimeNumber.cs Removed unused System imports and migrated to file-scoped namespace
DataStructures/Hashing/Entry.cs Removed unused System and local imports, migrated to file-scoped namespace
DataStructures/DisjointSet/DisjointSet.cs Removed unused System.Collections import, migrated to file-scoped namespace
DataStructures/Cache/LruCache.cs Removed unused System import
DataStructures/Cache/LfuCache.cs Removed unused System import
Algorithms/Stack/ReverseStack.cs Converted to file-scoped namespace
Algorithms/Stack/NextGreaterElement.cs Converted to file-scoped namespace
Algorithms/Stack/BalancedParenthesesChecker.cs Converted to file-scoped namespace
Algorithms/Sorters/Utils/GallopingStrategy.cs Removed unused imports and converted to file-scoped namespace
Algorithms/Sorters/Comparison/BasicTimSorter.cs Removed unused System.Collections import and converted to file-scoped namespace
Algorithms/Shufflers/RecursiveShuffler.cs Converted to file-scoped namespace
Algorithms/Shufflers/NaiveShuffler.cs Converted to file-scoped namespace
Algorithms/Shufflers/LINQShuffler.cs Removed unused imports and converted to file-scoped namespace
Algorithms/RecommenderSystem/ISimilarityCalculator.cs Removed unused System imports
Algorithms/Other/Triangulator.cs Removed unused imports and converted to file-scoped namespace
Algorithms/Other/JulianEaster.cs Removed unused System.Globalization import
Algorithms/Other/Geohash.cs Removed unused imports and converted to file-scoped namespace
Algorithms/Other/Geofence.cs Removed unused imports and converted to file-scoped namespace
Algorithms/Numeric/KrishnamurthyNumberChecker.cs Removed unused System import
Algorithms/Numeric/AdditionWithoutArithmetic.cs Removed unused System and System.Numerics imports

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

codecov bot commented Sep 7, 2025

Codecov Report

❌ Patch coverage is 99.18033% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.14%. Comparing base (00e9bc4) to head (f7d23cb).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
Algorithms/Sorters/Comparison/BasicTimSorter.cs 97.72% 0 Missing and 1 partial ⚠️
Algorithms/Stack/BalancedParenthesesChecker.cs 96.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #521      +/-   ##
==========================================
- Coverage   95.19%   95.14%   -0.05%     
==========================================
  Files         272      272              
  Lines       10921    10921              
  Branches     1536     1536              
==========================================
- Hits        10396    10391       -5     
- Misses        400      403       +3     
- Partials      125      127       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 1b9aa7e into TheAlgorithms:master Sep 7, 2025
4 checks passed
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