Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor: migrate to file-scoped namespaces and remove unused global usings statements #521

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
siriak merged 1 commit into TheAlgorithms:master from KaranChadha10:issue-520
Sep 7, 2025

Conversation

Copy link
Contributor

@KaranChadha10 KaranChadha10 commented Sep 6, 2025

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

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
edited
Loading

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
Reviewers

Copilot code review Copilot Copilot left review comments

@siriak siriak siriak approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /