Skip to content
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

Prefer require_relative for internal requires #939

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

tagliala
Copy link
Contributor

@tagliala tagliala commented 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:

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.92%. Comparing base (9cabeb6) to head (e20fa1a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #939   +/-   ##
=======================================
  Coverage   98.92%   98.92%           
=======================================
  Files          14       14           
  Lines         557      557           
=======================================
  Hits          551      551           
  Misses          6        6           

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

Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

❤️

`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 tagliala merged commit 0ea9ae8 into activeadmin:master Sep 19, 2024
21 checks passed
@tagliala tagliala deleted the chore/prefer-require-relative branch September 19, 2024 12:21
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
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