-
Notifications
You must be signed in to change notification settings - Fork 1
Fixed a few lint violations #14
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,8 +1,8 @@ | ||||||
| !> @file fclap_namespace.f90 | ||||||
| !> @brief Namespace module for fclap - stores parsed argument values. | ||||||
| !> | ||||||
| !> @details This module defines the Namespace type (similar to Python's | ||||||
| !> argparse.Namespace) which stores the results of parsing command-line | ||||||
| !> @details This module defines the Namespace type (similar to Python's | ||||||
| !> argparse.Namespace) which stores the results of parsing command-line | ||||||
| !> arguments. It provides getter methods for retrieving values by key. | ||||||
| !> | ||||||
| !> The Namespace acts like a dictionary, allowing you to retrieve | ||||||
|
|
@@ -13,7 +13,7 @@ | |||||
| !> character(len=256) :: filename | ||||||
| !> integer :: count | ||||||
| !> logical :: verbose | ||||||
| !> | ||||||
| !> | ||||||
| !> args = parser%parse_args() | ||||||
| !> call args%get("filename", filename) | ||||||
| !> call args%get("count", count, default=1) | ||||||
|
|
@@ -522,7 +522,7 @@ end function namespace_get_logical | |||||
| subroutine namespace_get_string_list(self, key, values, count) | ||||||
| class(Namespace), intent(in) :: self | ||||||
| character(len=*), intent(in) :: key | ||||||
| character(len=*), intent(out) :: values(:) | ||||||
| character(len=MAX_ARG_LEN), intent(out) :: values(:) | ||||||
| integer, intent(out) :: count | ||||||
| integer :: idx, i | ||||||
|
|
||||||
|
|
@@ -620,7 +620,7 @@ end subroutine namespace_show | |||||
| subroutine namespace_get_sub_string(self, key, value, default) | ||||||
| class(Namespace), intent(in) :: self | ||||||
| character(len=*), intent(in) :: key | ||||||
| character(len=*), intent(out) :: value | ||||||
| character(len=MAX_ARG_LEN), intent(out) :: value | ||||||
|
||||||
| character(len=MAX_ARG_LEN), intent(out) :: value | |
| character(len=*), intent(out) :: value |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, namespace_get_sub_string_list is used via the generic args%get(key, values, count) interface; making the element length fixed to MAX_ARG_LEN makes the generic call fail to resolve unless the actual argument length matches exactly. Recommend reverting to character(len=*), intent(out) :: values(:) or adding an overload to support arbitrary caller buffer lengths.
| character(len=MAX_ARG_LEN), intent(out) :: values(:) | |
| character(len=*), intent(out) :: values(:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing
valuesfrom assumed-length (character(len=*)) to fixed-lengthcharacter(len=MAX_ARG_LEN)makes the publicNamespace%get_string_listinterface length-dependent; callers withcharacter(len=...)arrays not exactlyMAX_ARG_LENwill fail to compile. Consider keepingcharacter(len=*), intent(out) :: values(:)(or providing an overload) so callers can choose their own buffer length and accept truncation/padding.