Skip to content

Conversation

@ivankatliarchuk
Copy link
Member

@ivankatliarchuk ivankatliarchuk commented May 17, 2025

Description

codebase uniformity benefits

  1. Reduced Cognitive Load During Code Review: When a codebase adheres to consistent style guidelines, naming conventions, and architectural patterns, reviewers can focus more on the logic and potential issues within the code changes rather than spending time deciphering unfamiliar or inconsistent formatting and structures. This allows for more efficient and insightful reviews, ultimately leading to higher quality code.
  2. Enhanced Readability: A uniform codebase is more predictable, making it easier for developers to follow and understand the code, thereby reducing the cognitive load.
  3. Easier Onboarding: When a codebase is consistent, new team members can get up to speed more quickly as they don’t have to adjust to different coding styles or paradigms in different parts of the codebase.
  4. Efficient Debugging and Maintenance: Uniformity in the codebase makes it easier to spot errors and maintain the code, as we know what to expect and where to look for potential issues.

Added nill-nill check.

  • This check reveal few issues
  • Removed duplicated code
  • Increased coverage for areas where code removed
  • clouflfare.go, fqdn.go and istio_* they have nil,nil return, that I'm not sure how to fix yet. Will try to fix in follow-up

Failed run https://github.com/kubernetes-sigs/external-dns/actions/runs/15087988069/job/42412985614?pr=5415
Screenshot 2025-05-17 at 19 39 26

coredns before
Screenshot 2025-05-17 at 20 27 02

coredns with this pr

Screenshot 2025-05-17 at 21 45 46

fixed shadowing
Screenshot 2025-05-17 at 22 31 55

Screenshot 2025-05-17 at 22 25 54
Screenshot 2025-05-17 at 21 58 59

Checklist

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot requested review from mloiseleur and szuecs May 17, 2025 18:34
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 17, 2025
@ivankatliarchuk ivankatliarchuk force-pushed the chore-code-added-nilnil-check branch from 0fce0e2 to dd3e819 Compare May 17, 2025 22:00
@ivankatliarchuk
Copy link
Member Author

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label May 17, 2025
@ivankatliarchuk ivankatliarchuk changed the title chore(code-quality): added nilnil return check chore(codebase-uniformity): added nilnil return check May 18, 2025
Copy link
Collaborator

@mloiseleur mloiseleur left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 19, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mloiseleur

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 19, 2025
@mloiseleur mloiseleur changed the title chore(codebase-uniformity): added nilnil return check chore(codebase): add nilnil return check May 19, 2025
@k8s-ci-robot k8s-ci-robot merged commit 791601e into kubernetes-sigs:master May 19, 2025
15 checks passed
@ivankatliarchuk ivankatliarchuk deleted the chore-code-added-nilnil-check branch May 19, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants