Prefer require_relative for internal requires#622
Merged
tagliala merged 1 commit intoactiveadmin:masterfrom Sep 19, 2024
Merged
Prefer require_relative for internal requires#622tagliala merged 1 commit intoactiveadmin:masterfrom
require_relative for internal requires#622tagliala merged 1 commit intoactiveadmin:masterfrom
Conversation
`require_relative` is preferred over `require` for files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path. This change updates internal requires to use `require_relative` for consistency, performance, and improved portability. Ref: - ruby/psych#522 - ruby/logger#20 - ruby/rdoc#658 - panorama-ed/memo_wise#349 - rubocop/rubocop#8748
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #622 +/- ##
=======================================
Coverage 94.31% 94.31%
=======================================
Files 17 17
Lines 457 457
=======================================
Hits 431 431
Misses 26 26 ☔ View full report in Codecov by Sentry. |
deivid-rodriguez
approved these changes
Sep 19, 2024
Member
deivid-rodriguez
left a comment
There was a problem hiding this comment.
Yes, this is awesome and a nice practice ❤️. Thank you!
tagliala
added a commit
to tagliala/inherited_resources
that referenced
this pull request
Sep 19, 2024
`require_relative` is preferred over `require` for files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path. This change updates internal requires to use `require_relative` for consistency, performance, and improved portability. Ref: - activeadmin/arbre#622
This was referenced Sep 19, 2024
tagliala
added a commit
to activeadmin/inherited_resources
that referenced
this pull request
Sep 19, 2024
`require_relative` is preferred over `require` for files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path. This change updates internal requires to use `require_relative` for consistency, performance, and improved portability. Ref: - activeadmin/arbre#622
tagliala
added a commit
to tagliala/activeadmin
that referenced
this pull request
Sep 19, 2024
`require_relative` is preferred over `require` for files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path. This change updates internal requires to use `require_relative` for consistency, performance, and improved portability. Ref: - activeadmin/arbre#622 - activeadmin/inherited_resources#939
tagliala
added a commit
to tagliala/activeadmin
that referenced
this pull request
Sep 19, 2024
`require_relative` is preferred over `require` for files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path. This change updates internal requires to use `require_relative` for consistency, performance, and improved portability. Ref: - activeadmin/arbre#622 - activeadmin/inherited_resources#939
tagliala
added a commit
to tagliala/activeadmin
that referenced
this pull request
Sep 19, 2024
`require_relative` is preferred over `require` for files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path. This change updates internal requires to use `require_relative` for consistency, performance, and improved portability. Ref: - activeadmin/arbre#622 - activeadmin/inherited_resources#939
tagliala
added a commit
to tagliala/activeadmin
that referenced
this pull request
Sep 20, 2024
`require_relative` is preferred over `require` for files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path. This change updates internal requires to use `require_relative` for consistency, performance, and improved portability. Ref: - activeadmin/arbre#622 - activeadmin/inherited_resources#939
tagliala
added a commit
to activeadmin/activeadmin
that referenced
this pull request
Sep 23, 2024
`require_relative` is preferred over `require` for files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path. This change updates internal requires to use `require_relative` for consistency, performance, and improved portability. Ref: - activeadmin/arbre#622 - activeadmin/inherited_resources#939
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @deivid-rodriguez, I ran into an issue that you are probably familiar with while experimenting with GemBench
If you think this is a good change, I'll do the same for inherited_resources
require_relativeis preferred overrequirefor files within the same project because it uses paths relative to the current file, making code more portable and less dependent on the load path.This change updates internal requires to use
require_relativefor consistency, performance, and improved portability.Ref:
require_relativefor internal requires ruby/psych#522require_relativerubocop/rubocop#8748