Conversation
|
Warning Rate limit exceeded@MrEx3cut0r has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 29 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis pull request adds a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Performance AnalysisAll benchmarks are within the acceptable range. No critical degradation detected (threshold is 100%). Please refer to the detailed report for more information. Click to see the detailed report
|
There was a problem hiding this comment.
Actionable comments posted: 12
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:
- Around line 103-124: parse-format-specifier currently stops flag parsing after
the first flag because it unconditionally sets parsing-flags to FALSE inside the
"then" branch; update the while-parsing-flags loop so that FALSE > parsing-flags
is only executed in the else branch when the current character is not a flag,
i.e., keep appending to flags and incrementing i when format.at i matches one of
"-+ 0#", and only set parsing-flags to FALSE when that match fails (preserve
existing variables: parse-format-specifier, flags, parsing-flags, i, format.at).
- Around line 326-401: The code in format-float-normal computes an integer
"rounded" but then derives int-part and frac-int by converting back to float via
rounded-value and subtraction, risking float precision errors; replace that
logic by computing int-part as div rounded multiplier and frac-int as mod
rounded multiplier (using the existing "rounded" and "multiplier" variables) and
remove reliance on rounded-value, so int-str and frac-str are derived from these
integer ops instead.
- Around line 27-102: The code does not check that an argument exists before
calling args.at arg-index inside the parts.each loop, so when there are more
format specifiers than values it will raise; update the parts.each handling
(where arg-index is read/incremented and sprintf.format-value is called) to
first check that arg-index < args.length (or that args.at arg-index is defined),
and if not either raise a clear error (e.g., "sprintf: missing argument for
format specifier") or substitute an empty string/placeholder before calling
sprintf.format-value; ensure arg-index is only incremented after a successful
fetch and keep references to arg-index, args.at arg-index, and
sprintf.format-value to locate the change.
- Around line 27-102: The code initializes processed-parts from parts and then
mutates it while iterating parts, which can corrupt the iteration and mix
non-string parts into string-parts; change the initialization so processed-parts
is a fresh empty list (use list > processed-parts) before the parts.each loop,
keep appends to processed-parts inside the parts.each (where args are formatted
and part.text appended), and ensure string-parts is built only from
processed-parts after the loop so it contains only strings.
- Around line 27-102: The loop index is being updated inconsistently: replace
the rebinding "new-i > i" with the in-place mutation used elsewhere by calling
"i.write new-i" so the loop variable is actually advanced; specifically, in the
sprintf function where parse-format-specifier is called (parsed.new-index >
new-i), change the subsequent "new-i > i" to "i.write new-i" to match the other
uses like "i.write (add i 1)" and the mutation pattern used inside
parse-format-specifier.
- Around line 153-156: The code calls format.at i to parse a specifier without
checking bounds, so if the template ends with a lone '%' this will index past
the end; modify the parsing logic around format.at i (and the subsequent i.write
(add i 1)) to first check whether i >= len (or equivalent length of format) and
handle that case explicitly—either treat the trailing '%' as a literal '%' or
raise a controlled error/exception—so that specifier parsing never performs an
unchecked out-of-bounds access.
- Around line 231-262: The current format-string logic wrongly treats width as a
maximum and truncates when len > width and also only applies precision when
precision > 0; change it so precision is applied for precision >= 0 (so
precision == 0 yields empty string) and only use precision to truncate the
original str (use substring when precision >= 0 and precision < str.length). For
width handling, do NOT truncate when len > width; only pad when len < width:
compute padding = width - len (positive) and if fmt.has-flag "-" (left-align)
append padding spaces after processed, otherwise prepend padding spaces before
processed; leave processed unchanged when len >= width.
- Around line 402-429: In format-hex, make the alternate-form prefix conditional
on the uppercase flag (when fmt.has-flag "#" and uppercase is true, use "0X",
otherwise "0x") instead of hardcoding "0x" so %X# produces "0X". Also remove the
fixed 32-bit two's-complement assumption: compute a bit-width from the magnitude
of value (e.g., bit-length rounded up to the next full byte or use a
configurable/default width) and use that computed width when adding sprintf.pow
2 <width> to negative values, or at minimum document why 32-bit is chosen if you
keep it; update the logic in format-hex where unsigned is computed and where the
prefix is concatenated (references: format-hex, uppercase, fmt.has-flag "#",
sprintf.pow, sprintf.integer-to-base, sprintf.concat,
sprintf.apply-width-padding).
- Around line 449-467: The loop in the integer-to-base routine incorrectly
rebinds the parameter with `div n base > n`, causing n not to change and an
infinite loop; replace that reassignment with the parameter mutation form used
elsewhere: call n.write(div n base) to update the existing n parameter inside
the while loop (in the function integer-to-base), ensuring the loop condition
(gt n 0) can become false.
🧹 Nitpick comments (2)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (2)
533-541: Recursiverepeat-char/powcan blow the stackBoth are linear recursion with depth
n/exp. If width/precision can be large, prefer an iterative implementation (or reuse a standard library helper if available).Also applies to: 543-551
103-551: API surface: helpers probably shouldn’t be exportedThis adds many public objects (
parse-format-specifier,format-*,pow, etc.). If they’re meant to be internal, nest them undersprintf(or apply whatever “private” convention EO runtime uses) to avoid locking in APIs.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: trufflehog
- GitHub Check: qulice
- GitHub Check: ort
- GitHub Check: pr-size
- GitHub Check: benchmark
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: integration
- GitHub Check: mvn (ubuntu-24.04, 17)
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: snippets
There was a problem hiding this comment.
Actionable comments posted: 10
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:
- Around line 338-417: The format-float and format-float-normal implementations
call isnan, isinf and int but those symbols are not imported; add
aliases/imports at the top of this EO file to pull isnan and isinf from the EO
float module and the integer conversion function used as int (or the correct EO
integer conversion name) so format-float (which checks NaN/Inf) and
format-float-normal (which calls int on rounded values) can reference them;
update imports/aliases accordingly and ensure the names match the calls inside
format-float and format-float-normal.
- Around line 471-474: format-scientific is a placeholder and must produce true
scientific notation for %e/%E; replace the placeholder delegation to
sprintf.format-float with code that: handle special cases (NaN/Inf) by
delegating to the existing helpers, compute exponent = floor(log10(abs(value)))
with exponent 0 for value==0, compute mantissa = value / 10^exponent, format the
mantissa using sprintf.format-float with the precision parsed from fmt, build
the exponent string as "e" or "E" depending on the uppercase flag and always
include a sign and at least two digits (e.g. e+03, e-10), and return the
concatenation of the formatted mantissa and exponent; update format-scientific
(the function defined as "[ value fmt uppercase ] > format-scientific") and
ensure format-value will use this for %e/%E.
- Around line 495-512: The while-loop in integer-to-base mutates n (via "div n
base > n"), which is invalid in EO; replace it with a pure recursive or
accumulator-based helper to avoid reassignment: create a tail-recursive helper
(e.g., integer-to-base.helper or integer-to-base.rec) that accepts the current
value and an accumulator/result string, on each step compute digit = mod value
base, newValue = div value base, and recurse with newValue and the updated
accumulator (using sprintf.concat with digit-to-char or int-to-hex-char),
returning the accumulator when newValue equals 0; update integer-to-base to call
this helper and remove any in-place mutation of n.
- Around line 275-336: Add the missing import for gte by adding "+alias
org.eolang.int.gte", and fix the zero-padding logic in format-integer: compute
padding and zero-pad flag as before but when zero-pad is true and padding>0
place the sign separately and insert zeros between the sign and digits (for
negative numbers produce "-" + repeat("0", padding) + digits) rather than
skipping zero-pad for negatives; ensure left-align still appends spaces and
non-zero-pad still prepends spaces to with-sign, using the existing symbols
digits, with-sign, negative, padding, left-align, zero-pad to locate the logic
to change.
- Around line 115-176: The parse-format-specifier routine calls string.as-number
for width and precision but that function should be imported from org.eolang.tt;
add the module alias import (alias org.eolang.tt.as-number) at the top of the
file and replace the two uses (in the width and precision parsing branches) of
string.as-number width-str and string.as-number precision-str with as-number
width-str and as-number precision-str respectively so parse-format-specifier
returns numeric width and precision correctly.
- Around line 1-603: The sprintf implementation fails to compile due to EO
syntax and API misuse: replace all illegitimate mutations like i.write(...) and
current.write(...) with EO mutable variable pattern (.put) and ensure loop
counters/mutables are declared as mutable objects; replace all .append usages on
lists with the immutable list builders (use .with or .withi where appropriate)
when constructing result/processed-parts/string-parts; add missing
aliases/imports for isnan, isinf and a string upper-case function (e.g., alias
org.eolang.string.to-upper or the correct module providing to-uppercase) and
verify string.as-number exists or replace with the proper conversion function;
audit and fix all numeric/string helpers (integer-to-base, integer-to-string,
pad-left, repeat-char, pow) to use correct EO primitives and imported functions
(e.g., mod/div/mul from aliased numeric modules) and adjust any type coercions
(string value, int conversions) to use the canonical EO conversion functions;
update each use of collection iteration (parts.each, string-parts.each) to use
EO collection APIs that return new lists instead of mutating, and add unit tests
for each formatter function (format-string, format-integer, format-float,
format-hex/octal/binary, apply-width-padding) covering flags, width/precision,
edge floats (NaN/Inf), escaped %% and argument indexing.
- Around line 579-597: The custom recursive repeat-char and pow are
unsafe/inefficient; replace repeat-char by delegating to the built-in
validator/accumulator implementation org.eolang.tt.repeated (i.e., call repeated
char n instead of implementing recursion in sprintf.repeat-char) so input is
validated and recursion is safe, and refactor sprintf.pow to an iterative or
accumulator-based loop (avoid deep recursion) by rewriting sprintf.pow to use a
simple multiply-accumulate pattern for exponentiation (or call a library/utility
if available) to ensure stability when computing powers like 10^precision or
2^32.
🧹 Nitpick comments (2)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (2)
208-241: Consider improving unknown specifier handling.Line 241 silently returns
"%" + specifierfor unknown format specifiers. This makes debugging difficult when an invalid format string is used. Consider either:
- Throwing an error for invalid specifiers
- Logging a warning
- At minimum, documenting this behavior
514-565: Consider simplifying character conversion using string indexing.The
int-to-hex-charanddigit-to-charfunctions use deeply nested if-else chains that are verbose and difficult to maintain. EO's string indexing (via.at) can simplify these to a single line:[ n ] > int-to-hex-char "0123456789abcdef".at n [ n ] > digit-to-char "0123456789".at nThis reduces ~50 lines of nested conditionals while maintaining the same behavior. String indexing is already used throughout the codebase (e.g.,
format.at iin the same file).
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🧰 Additional context used
🪛 GitHub Actions: snippets
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 1-999: Multiple parsing/transpilation errors detected in sprintf.eo during EO runtime transpilation (XMIR syntax errors preventing further processing).
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: benchmark
- GitHub Check: pr-size
- GitHub Check: trufflehog
- GitHub Check: qulice
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: integration
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: mvn (ubuntu-24.04, 17)
- GitHub Check: ort
🔇 Additional comments (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (1)
243-273: String formatting logic looks correct.Assuming the missing
stringimport is added, the logic for formatting strings with precision (truncation) and width (padding/alignment) appears correct.
There was a problem hiding this comment.
Actionable comments posted: 12
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:
- Around line 476-479: The placeholder format-scientific currently calls
sprintf.format-float and returns decimal output; replace it with a proper
scientific formatter that: parses the numeric value from the input (value) and
handles NaN/Inf/zero specially, computes the base-10 exponent by repeatedly
scaling the absolute mantissa to 1.0 ≤ m < 10.0 (or set exponent 0 for zero),
rounds the mantissa to the specified precision from fmt, formats the output as
"mantissa[.fraction]e±ee" using a lowercase 'e' or uppercase 'E' when the
uppercase flag is TRUE, and ensures exponent sign and at least two exponent
digits; update format-scientific (the function taking [ value fmt uppercase ])
to return that formatted string instead of delegating to sprintf.format-float.
- Around line 36-79: parts-with-escapes uses undefined collection and loop
symbols and mutates non-memory bindings; replace uses of `list` with `array` (or
a proper collection constructor used elsewhere), change the iteration from the
nonexistent `repeat` to a `while` driven by a memory counter (create a `memory`
for `i`), and convert `current` and `in-percent` (and any
`processed-parts`/`result`) into `memory` objects so `.write` and `.read` are
valid; ensure all `i.write(...)` updates the memory counter and
`current.write(...)`/`in-percent.write(...)` are used consistently, and invoke
existing helpers (`sprintf.parse-format-specifier`,
`sprintf.make-format-specifier`, `sprintf.make-part`, `sprintf.concat`) without
rebinding immutable vars.
- Around line 482-516: The apply-width-padding block calls substr with only two
arguments (e.g., substr str 2 and substr str 1) but the substr function requires
three parameters [str start end]; update those calls inside the
zero-padding/prefix handling in apply-width-padding to pass the correct end
index (for example use the string length or appropriate end offset like
(str.length) or (str.length) - 0 as needed) so the prefix is preserved and the
padded segment is correctly sliced; ensure all occurrences (the two hex branches
and the octal branch) are fixed to call substr with three arguments consistent
with substr's signature.
- Around line 269-343: In the format-integer routine the substr helper is called
with only two arguments (e.g., substr digits 1) which mismatches the defined
signature [ str start end ] and will fail at runtime; fix by passing an explicit
end index (for example the string length of digits/with-sign) to each substr
call inside format-integer (references: function format-integer, variables
digits and with-sign, and the substr calls used when zero-padding and handling
the sign/negative branches), or alternatively add/use a 2-arg substr wrapper
that supplies end = str.length and update the calls to use that wrapper.
- Around line 519-535: The integer-to-base implementation is attempting to
mutate the parameter n via n.write, which is invalid because parameters are
immutable; change the function to create a local memory cell (e.g., n-mem)
initialized with the incoming n, use n-mem.read when computing mod/div and use
n-mem.write to update the counter, and replace other direct uses of n in the
loop with reads from that memory; keep the rest of the logic (result memory,
digit calculation, concatenation via sprintf.concat and
digit-to-char/int-to-hex-char) unchanged.
- Around line 457-473: format-octal and format-binary must handle negative
integers and call apply-width-padding with the correct 4 arguments: for negative
handling, convert value with sprintf.unsigned (like format-hex does) before
passing to sprintf.integer-to-base (use sprintf.unsigned value 8 for octal and
sprintf.unsigned value 2 for binary); for padding, call
sprintf.apply-width-padding with four args: the string, fmt, fmt.has-flag "0"
(for zero-pad), and false (uppercase) — and in format-octal keep the existing
"#" prefix behavior by concatenating "0" before padding when fmt.has-flag "#" is
true.
- Around line 243-266: The code calls the string conversion operator via "string
value" in the format-string routine but the org.eolang.string alias is not
imported; add "+alias org.eolang.string" to the file's import section (after the
existing imports) so the string function is available, or replace the usage of
"string value" with the existing "as-string" method (used elsewhere) on the
value object (e.g., value.as-string) to perform the conversion consistently;
update the reference in format-string accordingly to eliminate the unresolved
symbol.
- Around line 426-455: The calls to sprintf.apply-width-padding inside
format-octal and format-binary are missing the required zero-pad and uppercase
parameters and must be invoked as sprintf.apply-width-padding processed fmt
FALSE FALSE > @ (for octal) and sprintf.apply-width-padding binary-str fmt FALSE
FALSE > @ (for binary); additionally, mirror format-hex's negative-value
handling in format-octal and format-binary by wrapping value with the same if.
lt value 0 add (sprintf.pow 2 64) value value > unsigned pattern before
converting to octal/binary so negatives use two's-complement, and consider
replacing the recursive sprintf.pow 2 64 with a platform-specific constant or
iterative computation to avoid deep recursion.
- Around line 1-32: The file declares unused alias imports which should be
removed to avoid dead code: remove the alias declarations for
org.eolang.io.stdout, org.eolang.txt.split, org.eolang.memory, and
org.eolang.array from the top-level aliases list so only actually used symbols
(e.g., org.eolang.txt.concat, org.eolang.txt.length, org.eolang.txt.substring,
org.eolang.txt.at, org.eolang.seq, float/int ops, org.eolang.bytes) remain;
update the alias block by deleting the lines containing those four alias entries
and run a quick build or linter to confirm no references remain.
- Around line 345-423: In format-float (and format-float-normal) remove calls to
nonexistent isnan/isinf and instead check the float object's properties or
compare against the special values: use the float's .is-nan property for NaN
detection and use .is-finite (negated) or compare against
positive-infinity/negative-infinity for infinity detection inside the
`format-float` routine; update the branches that currently call isnan/isinf
(symbols: format-float, value, fmt). In format-float-normal replace the
undefined `int (add scaled 0.5)` conversion with the proper EO integer
conversion for the float/number (e.g., call the available `as-i64`/`.as-i64`
method or the project’s canonical float-to-int helper) to produce `rounded`;
adjust use sites of `rounded`/`div`/`mod` accordingly (symbols:
format-float-normal, scaled, rounded). Ensure no references remain to
isnan/isinf or `int` and that sign handling and padding logic continue to use
the updated values.
🧹 Nitpick comments (3)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (3)
178-186: Consider simplifying digit check.The deeply nested
orexpressions for digit checking are correct but verbose. If EO supports character code comparison or regex, consider using those for better readability.Alternative approach if EO supports it
# If character codes are supported: [ ch ] > is-digit and gte (ch.code) 48 # '0' lte (ch.code) 57 # '9'
559-587: Deeply nested conditionals for digit conversion.The
digit-to-charfunction uses 10 levels of nested if-else statements. While functionally correct, this could be simplified.Consider using a lookup approach if EO supports arrays/tuples, or at minimum, use a balanced tree of conditions to reduce maximum nesting depth.
Example with balanced conditions
[ n ] > digit-to-char if. lt n 5 if. lt n 3 if. lt n 2 if. (eq n 0) "0" "1" if. (eq n 2) "2" "3" if. eq n 4 "4" if. (eq n 5) "5" "6" # ... continue balancingThis reduces maximum nesting from 10 to about 4 levels.
602-619: Recursive implementations may cause stack overflow.Both
repeat-char(lines 602-609) andpow(lines 612-619) use recursion without tail-call optimization.For large values:
repeat-char " " 1000would create 1000 stack framespow 10 100would create 100 stack framesConsider iterative implementations:
Iterative alternatives
For
repeat-char:[ char n ] > repeat-char memory > counter memory > result seq > _ counter.write n result.write "" while (gt counter 0) result.write (sprintf.concat result char) counter.write (sub counter 1) result > @For
pow:[ base exp ] > pow memory > counter memory > result seq > _ counter.write exp result.write 1 while (gt counter 0) result.write (mul result base) counter.write (sub counter 1) result > @
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🧰 Additional context used
🪛 GitHub Actions: snippets
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 1-1: Maven transpile failed for eo-runtime: 'MjTranspile' execution failed due to errors parsing/processing sprintf XMIR.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: mvn (ubuntu-24.04, 17)
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: trufflehog
- GitHub Check: ort
- GitHub Check: pr-size
🔇 Additional comments (4)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (4)
208-240: LGTM: Format dispatcher logic is sound.The format-value dispatcher correctly routes to specialized formatters based on the specifier character. The fallback to
sprintf.concat "%" specifierfor unknown specifiers is appropriate.The deeply nested if-else structure is understandable given EO's syntax. If EO supports pattern matching or case-like constructs, that could improve readability, but this is acceptable.
203-204: The code is correct - no action needed. Theflagsparameter is of typelist, which has acontainsmethod that checks whether an element exists in the collection. This method is properly defined in thelisttype and works as expected.
629-634: Verify whethertxt.concatalias provides the needed functionality.
org.eolang.txt.concatis imported at line 7 but is never used in this file. Instead, a manual concatenation implementation is used (lines 629-634) that converts strings to bytes, appends them, and converts back. Before using the manual approach, confirm thattxt.concateither (1) doesn't support the required string concatenation interface, or (2) has performance or behavioral differences that necessitate the custom implementation. Iftxt.concatworks correctly for your use case, replace the ~40 calls tosprintf.concatwith it to reduce code duplication.
625-627: Verify substring method signature with runtime implementation.The
substrhelper callsstr.substring start end, assuming the method accepts end index parameters. While the codebase importsorg.eolang.txt.substringand uses it with index-based arguments, the actual definition could not be found in the repository (it appears to be native). Confirm the signature matches the usage; note thatsliceelsewhere uses length-based parameters[text start len], so ensuresubstringuses end indices, not length.
|
@MrEx3cut0r this task seems to be too hard for an LLM :) |
|
Yeah, its hard for LLM |
There was a problem hiding this comment.
Actionable comments posted: 11
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:
- Around line 489-494: format-float-simple currently returns a numeric float
(via as-float) but must return a formatted string; change format-float-simple
to: convert value to a float, handle sign, split into integer and fractional
parts, round the fractional part to the given prec (handle carry into integer),
convert integer part to string (use the existing integer conversion helper if
present), build the fractional string padded with zeros to prec (omit the
decimal part when prec is zero), and return the combined string so callers like
join-parts receive a string instead of a float.
- Around line 647-651: The substring calls in sprintf.eo are missing the end
index: replace the three occurrences of str.substring 2 and str.substring 1 with
explicit end indices (e.g., str.substring 2 str.length and str.substring 1
str.length) so they match the two-argument signature used elsewhere (like
str.substring 0 precision); update the two hex branches and the octal branch to
pass str.length as the end parameter.
- Around line 242-246: The code binds width-str to an immutable string and then
calls width-str.write, which fails; replace width-str with a mutable memory cell
(e.g., a memory object) and use that memory's put/write operations to accumulate
characters inside the while loop; update the loop to call the memory write/put
on the memory identifier you choose (referencing the existing i-mem,
sprintf.concat and format.at usage) and ensure any later reads of width-str use
the memory's get/value method instead of treating it as a plain string.
- Around line 230-239: The code treats parsing-flags as mutable by binding TRUE
> parsing-flags and later attempting FALSE > parsing-flags, but EO bindings are
immutable; replace parsing-flags with a memory cell (e.g., parsing-flags-mem)
like i-mem and flags-mem, initialize it with TRUE, read it in the while
condition, and write FALSE into it instead of rebinding; update references
inside the loop (the while condition and where FALSE > parsing-flags occurs) to
use parsing-flags-mem.get and parsing-flags-mem.put so the flag state actually
changes.
- Around line 527-543: format-octal and format-binary currently pass negative
values directly to integer-to-base; mirror format-hex's negative handling (the
logic around format-hex at lines ~498-503) by detecting negative value inputs
and converting them to their two's complement representation before calling
sprintf.integer-to-base. Update format-octal and format-binary to compute the
two's-complement adjusted value the same way format-hex does, then proceed with
the existing prefix/width-padding logic (keep function names format-octal,
format-binary, and integer-to-base as references).
- Around line 271-273: When parsing the specifier you must check bounds before
calling format.at with i-mem.get: if i-mem.get is >= total-len (meaning the
format ends without a specifier) avoid calling format.at and instead handle the
error (e.g., raise/return a clear FormatError or treat the trailing '%' as
literal) and do not advance i-mem.put; add this check immediately before the
format.at (i-mem.get) > specifier-char use so specifier-char is only read when
in-range.
- Around line 376-386: The seq blocks inside format-integer create local
bindings for negative and abs-value that are not visible later; change them to
persistent bindings using memory (e.g., create memory cells for negative and
abs-value before the if. and write to them inside each seq) or eliminate the
outer variables by computing the needed values inline where referenced; update
the code that later reads negative and abs-value to read from the memory cells
(or the inline expressions) so those values are available outside the seq
blocks.
- Around line 88-97: The parser uses EO's ternary if. but several calls (notably
the if. wrapping gt (current-str.length) 0 -> result-mem.put
(current-result.with (sprintf.make-part current-str FALSE)) and the subsequent
current-mem.put "" / in-percent-mem.put TRUE sequence, plus similar if. usages
around the escaped-%% check and at the other spots you mentioned) are missing
the required else branch; update each if. expression in sprintf.eo (including
the one using gt, and the ones around lines referenced 98 and 135) to include a
third argument (a no-op else branch such as an empty seq or explicit noop
expression) so every if. has condition, then-branch and else-branch, preserving
the current then-branch behavior and ensuring runtime validity.
- Around line 6-13: The code defines an alias for org.eolang.txt.concat (making
the symbol concat available), but places still call txt.concat; update the call
site that uses txt.concat a b > @ to use the aliased symbol concat instead
(i.e., replace txt.concat with concat wherever that usage occurs, e.g., the
sprintf implementation that currently references txt.concat).
- Around line 309-312: The helper has-flag currently calls flags.contains which
is invalid for EO arrays; replace that call by either wrapping the array with
the list wrapper from org.eolang.ss.list (e.g., convert flags to a list and then
call .contains) or implement a simple loop/search over flags to check equality
against flag; update the has-flag definition accordingly (refer to the has-flag
entry and the flags parameter) so it uses a valid contains on the list wrapper
or manual iteration rather than calling .contains on the raw array.
🧹 Nitpick comments (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (1)
156-158: Unused bindingcurrent-processed.
current-processedis bound on line 157 but never used—the code correctly usesprocessed-mem.getdirectly in lines 180 and 184. This is dead code that can be removed.♻️ Proposed fix
array > processed-init processed-mem.put processed-init - # Get current processed list - processed-mem.get > current-processed - # Process each part using a while loop with index
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-17T14:21:45.092Z
Learnt from: h1alexbel
Repo: objectionary/eo PR: 4637
File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31
Timestamp: 2025-10-17T14:21:45.092Z
Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
Applied to files:
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: ort
- GitHub Check: trufflehog
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: mvn (ubuntu-24.04, 17)
- GitHub Check: pr-size
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: snippets
- GitHub Check: qulice
- GitHub Check: benchmark
- GitHub Check: integration
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:
- Around line 41-43: The three alias lines were pointed at the wrong package
name; update the aliases for as-integer, as-float, and repeated to reference
org.eolang.txt instead of org.eolang.tt so the imports resolve correctly (i.e.,
change the alias targets for the symbols as-integer, as-float, and repeated in
sprintf.eo to use org.eolang.txt).
- Around line 45-46: The object is declared with the full package-qualified name
org.eolang.io.sprintf, which is inconsistent with other objects in the
org.eolang.io package; update the object declaration line to use the simple name
sprintf instead of the package prefix (change the declaration from [] >
org.eolang.io.sprintf to [] > sprintf) so the object name matches the
established naming convention used by stdout, stdin, etc.
- Around line 672-676: The code creates abs-value only inside the two if.
branches so it isn’t visible later when computing the mantissa; fix by ensuring
abs-value is bound in the outer scope—either declare/initialize abs-value before
the if. and then assign to it inside each branch, or refactor the if. to be an
expression that assigns its result to abs-value (e.g., replace the separate
branch-local bindings with a single assignment like if. lt value 0 then mul
value -1 else value > abs-value) so abs-value is available when used later.
- Around line 287-305: The specifier-char is declared only inside the
conditional branches and thus is not in scope when building parsed-result;
refactor the if. block so it returns the specifier character (use the if.
expression's result to yield specifier-char) and bind that returned value to a
top-level specifier-char before constructing parsed-result (e.g., have each
branch produce the specifier char and do: if. ... > specifier-char), leaving
parsed-result to read specifier-char, width-value, precision-value,
flags-mem.get and i-mem.get as before.
- Around line 885-888: The local helper named "concat" shadows the intended
referenced concat function and can cause infinite recursion; rename the helper
(e.g., to "concat-helper" or "join") or call the fully qualified function
"org.eolang.txt.concat" inside the helper instead of "concat a b" so the
implementation uses the external concat; update the helper declaration "[ a b ]
> concat" and its internal call consistently (or replace the internal call with
"org.eolang.txt.concat a b") to eliminate the name collision.
- Around line 265-285: precision-value is set to -1 but the inner seq creates a
new local binding so the outer precision-value never changes; change the code so
precision-value is assigned the result of the if. expression rather than
re-bound inside the seq. Concretely, remove the inner "> precision-value"
binding and have the if. that parses precision-str return either as-integer
precision-str or 0, then assign that result to precision-value (e.g., replace
the outer initialization + nested seq with a single expression that does: (if.
(and (lt (i-mem.get) total-len) (eq (format.at (i-mem.get)) \".\"))
<parse-and-return-int-or-0> -1) > precision-value), keeping the existing
helpers (i-mem, precision-str-mem, precision-str, sprintf.is-digit, format.at)
unchanged.
- Around line 706-713: The if-branch defines sign and exp-abs inside nested seq
blocks so they are out of scope later; declare mutable holders before the if
(e.g., create mem objects or top-level attributes named sign and exp-abs) and
then assign to them inside each branch (use the same assignment expressions
currently in the seq blocks) so sign and exp-abs are defined in the outer scope
and available where referenced later (replace the inner seq-bound bindings with
assignments into the predeclared sign and exp-abs).
🧹 Nitpick comments (2)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (2)
564-573: Confusing duplicate binding ofnumber-str.The binding at line 570 creates
number-strinside theseqblock, and line 573 binds the entireif.result tonumber-str. The inner binding at line 570 is unnecessary sinceseqreturns its last expression anyway. This pattern is confusing and error-prone.♻️ Simplify by removing redundant inner binding
if. gt prec 0 seq sprintf.integer-to-string frac-int > frac-str sprintf.pad-left frac-str prec "0" > frac-padded # Combine with decimal point - sprintf.concat int-str (sprintf.concat "." frac-padded) > number-str + sprintf.concat int-str (sprintf.concat "." frac-padded) # prec == 0, just integer part int-str > number-str
435-447: Confusing precision logic for integers.The condition at line 440 includes
(and (eq fmt.precision 0) (eq (abs-value-mem.get) 0))to handle the%.0dwith value0case, but then lines 442-445 check precision again. The nested if at line 442 is redundant since the outer condition already ensuresprecision >= 0. Consider simplifying:♻️ Proposed simplification
# Apply precision (minimum digits) - including precision == 0 if. gte fmt.precision 0 - seq - str.length > len - if. - or (lt len fmt.precision) (and (eq fmt.precision 0) (eq (abs-value-mem.get) 0)) - sprintf.concat (sprintf.repeat-char "0" (fmt.precision - len)) str - if. - eq fmt.precision 0 - "" # %.0d with value 0 renders empty - str + if. + and (eq fmt.precision 0) (eq (abs-value-mem.get) 0) + "" # %.0d with value 0 renders empty + seq + str.length > len + if. + lt len fmt.precision + sprintf.concat (sprintf.repeat-char "0" (fmt.precision - len)) str + str str > digits
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-17T14:21:45.092Z
Learnt from: h1alexbel
Repo: objectionary/eo PR: 4637
File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31
Timestamp: 2025-10-17T14:21:45.092Z
Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
Applied to files:
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: trufflehog
- GitHub Check: snippets
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: benchmark
- GitHub Check: mvn (ubuntu-24.04, 17)
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: ort
- GitHub Check: qulice
- GitHub Check: pr-size
🔇 Additional comments (5)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (5)
794-805: Consider stack depth for large numbers.The tail-recursive helper for base conversion could hit stack limits for very large numbers (e.g., 64-bit integers in binary would require ~64 recursive calls). For typical use cases this should be fine, but worth noting.
307-316: LGTM!The
is-digithelper correctly checks character values 0-9 using chainedorconditions.
317-353: LGTM!The
make-partandmake-format-specifierfactories are well-structured. Thehas-flagmethod correctly uses memory for iterative search through the flags array.
829-859: Consider simplifying digit-to-char.The implementation is correct but verbose. An alternative approach could use character code arithmetic if EO supports it, but the explicit mapping is clear and maintainable.
591-596: The two's complement computation usingsprintf.int-pow 2 64will overflow.The iterative multiplication in
int-powwill overflow after 63 iterations (since 2^63 exceeds the maximum signed 64-bit integer). Additionally, in Java's signed long arithmetic, computing2^64 + negative_valueitself overflows, making the two's complement conversion invalid.However, this code in
org.eolang.io.sprintfis not the active sprintf implementation. The runtime usesorg.eolang.tt.sprintf(which delegates to Java'sString.format()), so this overflow doesn't currently occur. Iforg.eolang.io.sprintfis intended for future use or as an alternative implementation, the two's complement handling needs to be fixed to work within 64-bit signed integer constraints.
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:
- Around line 289-307: The specifier-char is declared inside the if branches and
thus not visible when building parsed-result; make specifier a shared memory
cell and assign into it inside each branch (e.g., create a specifier-mem
alongside i-mem and use specifier-mem.put in both the normal-parse and literal-%
branches), then read specifier-mem.get when constructing parsed-result (keep
using i-mem.get for new-index); update references from specifier-char to
specifier-mem.get so the parsed-result can access the value outside the
conditional.
- Around line 887-889: The local helper "[ a b ] > concat" shadows the imported
alias org.eolang.txt.concat and causes infinite recursion; remove this local
wrapper or rename it (e.g., to concat_local) and update all uses accordingly —
either delete the helper and replace all "sprintf.concat" calls with the
imported "concat" alias, or rename the helper and change its callers to the new
name (or use a fully qualified "org.eolang.txt.concat" where needed) so the code
calls the intended imported function instead of recursing into itself.
- Around line 47-50: The EO parser fails because the line `"Formats a string
using a template and arguments" > @doc` is not valid object syntax; remove that
line and place the description as a `#` comment above the `sprintf` object or
refactor `sprintf` to accept `[ format args ] > main` directly (i.e., make
`sprintf` take `format` and `args` as parameters rather than using the invalid
`"..." > @doc` expression); after removing the doc line, update any references
inside `sprintf`/`main` to use the actual `format` and `args` parameters to
ensure the implementation compiles.
- Around line 267-286: The precision parsing currently assigns to a shadowed
local `precision-value` inside the `if` sequence so the outer `precision-value`
remains -1; change this to use a memory cell (e.g., `precision-value-mem`)
declared outside/above the `if` like the other parsed values, write the parsed
integer into `precision-value-mem.put` instead of creating a nested
`precision-value`, and replace subsequent reads of `precision-value` with
`precision-value-mem.get` (or set the outer `precision-value` from the memory)
so the computed precision propagates correctly for format specifiers.
🧹 Nitpick comments (3)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (3)
6-12: Consider removing unused aliases.The aliases
stdout,split, andreplaceappear to be unused in the implementation. Removing them would reduce clutter.
552-560: Floating-point precision may cause edge-case rounding errors.The rounding approach on lines 553-555 (
scaled → rounded → rounded-val) works for typical cases, but floating-point arithmetic can introduce small errors in edge cases (e.g.,0.15with precision 1 might render as0.1instead of0.2).This is a known limitation of this approach and may be acceptable for this implementation.
182-191: Theseq > noop5pattern is confusing but functional.The empty
seq > noop5(line 187) serves as a trailing statement in the seq block, which is an unusual pattern. Consider restructuring for clarity, though it's not functionally incorrect.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-17T14:21:45.092Z
Learnt from: h1alexbel
Repo: objectionary/eo PR: 4637
File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31
Timestamp: 2025-10-17T14:21:45.092Z
Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
Applied to files:
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🪛 GitHub Actions: integration
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 48-48: eo-runtime: [48:55] error: 'Invalid object declaration' in doc string for sprintf. (Might indicate malformed XMIR generation)
🪛 GitHub Actions: mvn
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 48-48: Failed to parse: [48:55] error: 'Invalid object declaration' - doc line.
[error] XMIR should have either '/object/o/@name' or '/object/class/@name' attribute.
[error] Identifier of the tojo ('org.eolang.io.sprintf') does not match the discovered XMIR name.
🪛 GitHub Actions: qulice
🪛 GitHub Actions: snippets
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 48-55: Failed to parse 'eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:48': [48:55] error: 'Invalid object declaration'. XMIR should have a valid object declaration near the doc line. (Command: mvn clean install -Psnippets --errors --batch-mode)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: trufflehog
- GitHub Check: pr-size
🔇 Additional comments (9)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (9)
674-678: Potential scoping issue with inline bindings in conditional branches.The pattern
mul value -1 > abs-valueandvalue > abs-valueinside conditional branches may not makeabs-valueaccessible on line 687 where it's used. This depends on how EO handles inline bindings withinifexpressions.Verify whether inline bindings like
(expr > var)insideifbranches are accessible outside theifin EO. If not, usememorycells similar to other parts of this code.
708-717: Same scoping issue:signandexp-absdeclared in branches, used outside.Variables
sign(lines 711, 714) andexp-abs(lines 712, 715) are declared insideif/seqbranches but used on lines 717 and 729-730 outside those branches. This follows the same potentially problematic pattern.
592-598: Verify 64-bit integer support for two's complement conversion.The two's complement conversion using
add (sprintf.int-pow 2 64) valueassumes EO integers can handle values up to 2^64. Verify that EO's integer type supports this range without overflow.
786-807: LGTM: Base conversion logic is correct.The tail-recursive approach for integer-to-base conversion is well-structured. The separation of
digit-to-char(0-9) andint-to-hex-char(10-15) handles hexadecimal digits correctly.
309-317: LGTM: Digit checking is verbose but correct.The nested
orstructure correctly identifies digit characters 0-9. While verbose, this works given EO's constraints.
391-415: LGTM: String formatting with width and alignment looks correct.The precision truncation (lines 398-402) and width padding (lines 405-414) implement standard sprintf behavior for
%scorrectly.
874-876: LGTM: Correctly delegates to the aliasedrepeatedfunction.
891-891: LGTM: Correctly bindsmainas the sprintf result.The
main > @binding properly exposes the main formatting function as the sprintf object's value.
41-43: Remove aliases to non-existent objects:org.eolang.tt.as-integerandorg.eolang.tt.as-floatdo not exist.The objects
org.eolang.tt.as-integerandorg.eolang.tt.as-floatare not defined in theorg.eolang.ttpackage. Onlyorg.eolang.tt.repeatedexists as a valid concrete object. Aliases can only point to concrete objects that exist; remove the invalid aliases foras-integerandas-float.⛔ Skipped due to learnings
Learnt from: h1alexbel Repo: objectionary/eo PR: 4637 File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31 Timestamp: 2025-10-17T14:21:45.092Z Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @eo-runtime/pom.xml:
- Around line 171-176: Remove the stray blank line before the <dependency> block
for org.eolang:eo-strings (artifactId "eo-strings", version "0.1.1"); keep the
dependency as-is (no <scope> change) and reformat so the dependency block
directly follows the previous XML element with no extra empty line to match the
project's existing pom formatting.
In @eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:
- Around line 24-60: The sprintf EO implementation is invalid: it uses
multi-binding in remaining.each-with-index > part i (invalid), attempts mutable
updates via result.write and concat result (EO is immutable), misuses
parts.slice/argument syntax, and has branches that don’t return EO objects.
Replace the imperative accumulation with a functional approach: parse format
into parts, then use a pure reducer/recursion that returns a new string object
each step (no .write), correctly bind the iteration variables (e.g., have
each-with-index produce a pair or iterate with a single name and extract index),
call slice with proper EO argument syntax to produce remaining, and ensure every
seq/if. branch yields a value; use args.at to fetch substitutions and
string-concatenation functions to produce the final string in the sprintf object
rather than mutating a result.
🧹 Nitpick comments (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (1)
12-12: Missing unit tests for sprintf.The
+unlint unit-test-missingdirective suppresses the lint warning, but tests should be added to verify the sprintf functionality once the syntax issues are resolved. The PR comments indicate this implementation was challenging, making thorough testing even more important.Do you want me to help generate EO test cases for sprintf once the implementation is corrected?
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
eo-runtime/pom.xmleo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-17T14:21:45.092Z
Learnt from: h1alexbel
Repo: objectionary/eo PR: 4637
File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31
Timestamp: 2025-10-17T14:21:45.092Z
Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
Applied to files:
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🪛 GitHub Actions: integration
eo-runtime/pom.xml
[error] 1-1: Failed to transpile: 'MjTranspile' execution failed during EO runtime build. See logs for details about XMIR syntax errors in sprintf.xmir.
[error] 1-1: Maven build failed: transpile step of eo-runtime failed. Command: mvn clean install -PskipUTs --errors --batch-mode
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 29-29: Invalid object declaration. [29:8] error: 'Invalid object declaration'.
🪛 GitHub Actions: qulice
🪛 GitHub Actions: snippets
eo-runtime/pom.xml
[error] 1-1: mvn clean install -Psnippets --errors --batch-mode (overall pipeline step) failed
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 29-29: Failed to parse: [29:8] Invalid object declaration in sprintf.eo.
[error] 1-1: XMIR should have either '/object/o/@name' or '/object/class/@name' attribute.
[error] Source/XMIR name mismatch: the identifier of the source file ('org.eolang.io.sprintf') does not match the discovered object in XMIR.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: pr-size
- GitHub Check: benchmark
- GitHub Check: trufflehog
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: mvn (ubuntu-24.04, 17)
- GitHub Check: ort
🔇 Additional comments (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (1)
1-7: The aliased objects do not exist in the codebase.
org.eolang.arrayis not defined anywhere. Theorg.eolang.txtpackage and its objects (concat,split,at,substring,length) do not exist. Onlyorg.eolang.seqis available. These aliases will fail at runtime when sprintf attempts to use them.⛔ Skipped due to learnings
Learnt from: h1alexbel Repo: objectionary/eo PR: 4637 File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31 Timestamp: 2025-10-17T14:21:45.092Z Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:
- Around line 94-142: The int-to-str object is using imperative mutation and
non-existent methods (shadowing n via `mul arg -1 > n` / `div n 10 > n`, a
`while` loop, and `digits.write`) which prevents termination and never builds
the string; replace the whole implementation of int-to-str with a pure recursive
approach: handle sign once (in int-to-str, set sign and initial positive n
without re-binding the same `n`), then implement a helper recursive function
(e.g., digit-rec or to-digits) that takes the current n and an accumulator
string and returns the concatenated digits by computing `mod n 10` and recursing
with `div n 10` (producing a new binding for the recursive parameter, not
shadowing outer variables) until n == 0, and build each character via concat (no
.write). Finally return concat(sign, result) from int-to-str. Ensure you do not
use `while` or `.write`, do not reassign outer `n`, and expose/rename helper
symbols so they are locatable in the diff (int-to-str, sign,
digit-rec/to-digits).
- Around line 4-8: Remove the two unused aliases imported from org.eolang.txt:
delete the alias declarations for split and substring so only the used aliases
(concat, at, length) remain; locate the alias lines near the top of sprintf.eo
and remove the lines containing "alias org.eolang.txt.split" and "alias
org.eolang.txt.substring" to clean up unused imports.
🧹 Nitpick comments (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (1)
12-28: Remove unused aliases.Several aliases are declared but never used in the implementation:
org.eolang.int.sub(line 13)- All float operations (lines 20-28):
float.add,float.sub,float.mul,float.div,float.lt,float.gt,float.eq,float.isnan,float.isinfThe float formatting on lines 157-158 simply converts to string without using any float-specific operations.
-+alias org.eolang.int.sub ... -+alias org.eolang.float.add -+alias org.eolang.float.sub -+alias org.eolang.float.mul -+alias org.eolang.float.div -+alias org.eolang.float.lt -+alias org.eolang.float.gt -+alias org.eolang.float.eq -+alias org.eolang.float.isnan -+alias org.eolang.float.isinf
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-17T14:21:45.092Z
Learnt from: h1alexbel
Repo: objectionary/eo PR: 4637
File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31
Timestamp: 2025-10-17T14:21:45.092Z
Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
Applied to files:
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🪛 GitHub Actions: integration
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 42-42: EO: Invalid object declaration in sprintf.eo at line 42.
🪛 GitHub Actions: mvn
🪛 GitHub Actions: qulice
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 42-42: Invalid object declaration
🪛 GitHub Actions: snippets
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 42-42: Failed to parse 'eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:42': [42:12] error: 'Invalid object declaration'
[error] 1-1: MjTranspile execution failed. Failed to process 'org.eolang.io.sprintf' (org.eolang.maven.TjForeign); source '/home/runner/work/eo/eo/eo-runtime/target/eo/1-parse/org/eolang/io/sprintf.xmir' encountered broken syntax
|
@yegor256 can you please help me? |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/sprintf.eo:
- Around line 31-32: The binding for the recursive function is malformed: the
`rec` object (declared in the `process-recursive` block) must have its `>
recursive-function` binding attached immediately to its object definition rather
than as a standalone line; modify the `rec` declaration so its final line reads
with the `> recursive-function` binding inline (or alternatively remove the
orphaned `> recursive-function` and reference `rec` correctly where the
recursion starter currently references `recursive-function`), ensuring
`process-recursive`, `rec`, and the recursion starter all use the same
identifier and scoping consistently.
- Around line 44-47: In the nested seq block around the format iterator (the
sequence that updates next-index and reads next-ch via "add index 1 >
next-index" and "format.at next-index > next-ch"), remove the blank line between
the "format.at next-index > next-ch" statement and the following comment/if
block so there is no empty line inside the seq; ensure the statements and the
subsequent conditional/comment are contiguous to avoid EO parsing/whitespace
issues.
- Around line 88-130: The to-digits object is declared parameterless but later
invoked with two args; either change its declaration to accept parameters (e.g.,
define to-digits [n acc] > digit-rec so it forwards n and acc to digit-rec) or
stop calling to-digits and call digit-rec directly with (positive-n, "") to
produce digits; update the invocation (to-digits positive-n "") or the object
signature accordingly and ensure the created/used symbol names remain to-digits,
digit-rec, positive-n and digits.
- Around line 36-40: The parse failure is caused by an empty line inside the seq
block that separates its arguments; in the seq containing "format.at index > ch"
and the subsequent "if." remove the blank line (or move any comment to the same
line) so the seq arguments remain contiguous, ensuring "format.at index > ch"
and "if." are consecutive expressions within the seq.
- Around line 1-26: The aliases list contains unused/non-existent symbols;
remove the unused aliases (org.eolang.int.sub, org.eolang.int.gt and all
org.eolang.float.* entries) and delete or correct the non-existent txt aliases
(org.eolang.txt.concat, org.eolang.txt.at, org.eolang.txt.length). Then either
change the implementation to call concatenation/substring/length as methods on
the appropriate objects (i.e., use the bytes/string object method form rather
than a free function named concat/at/length) or add concrete EO object
definitions for txt.concat, txt.at and txt.length if you intend them as
standalone objects; ensure references to concat in the code use the runtime’s
method calling convention (method on the bytes/text object) and update aliases
accordingly (keep only aliases that map to actual, used symbols like
org.eolang.seq or org.eolang.int.add).
🧹 Nitpick comments (1)
eo-runtime/src/main/eo/org/eolang/sprintf.eo (1)
96-123: Consider simplifying digit-to-character mapping.The deeply nested if-else chain for converting digits 0-9 to strings is verbose and error-prone. Consider using an array/tuple lookup or a more concise mapping approach if EO supports it.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/sprintf.eo
🧰 Additional context used
🪛 GitHub Actions: mvn
eo-runtime/src/main/eo/org/eolang/sprintf.eo
[error] 38-38: Invalid object declaration.
[error] XMIR should have either '/object/o/@name' or '/object/class/@name' attribute.
[error] The identifier of the tojo ('org.eolang.sprintf') does not match the object discovered in the XMIR after parsing ('').
🪛 GitHub Actions: qulice
eo-runtime/src/main/eo/org/eolang/sprintf.eo
[error] 38-38: Failed to parse: Invalid object declaration in sprintf.eo:38
[error] 1-1: 'MjTranspile' execution failed: java.io.UncheckedIOException: java.io.IOException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Failed to process 'org.eolang.sprintf' (org.eolang.maven.TjForeign)
🪛 GitHub Actions: snippets
eo-runtime/src/main/eo/org/eolang/sprintf.eo
[error] 38-38: Invalid object declaration in sprintf.eo at line 38.
[error] 1-1: 'MjTranspile' execution failed during transpile step for eo-runtime: Failed to process 'org.eolang.sprintf' (org.eolang.maven.TjForeign).
🔇 Additional comments (1)
eo-runtime/src/main/eo/org/eolang/sprintf.eo (1)
76-86: Verifyseqwith bindings produces expected behavior.The
seqblocks at lines 80-82 and 83-85 are used to conditionally bindsignandpositive-n. In EO,seqreturns its last expression. Ensure that these bindings persist in scope as intended and that the object evaluation order is correct.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/sprintf.eo:
- Around line 76-82: The bytes construction using "bytes \"%\" spec" is invalid;
change it to explicitly concatenate the percent sign and the spec character into
a single bytes value before passing to result.concat. Locate the seq branch that
calls result.write -> result.concat -> bytes (around the atoms seq,
result.write, result.concat, bytes, spec) and replace the two-argument bytes
call with an explicit concatenation of "%" and spec (e.g., create a bytes "%"
then concat spec into it) and keep the subsequent pos.write (pos.plus 2) logic
unchanged.
- Around line 5-10: The alias declaration for org.eolang.mem is unused while the
code references memory; fix by making the alias match the identifier used or
vice-versa: either change the alias to alias org.eolang.memory so the existing
references to memory resolve, or update the code to use mem in the places that
reference memory (lines using memory in sprintf.eo), ensuring references to
memory/mem and the alias name (org.eolang.mem or org.eolang.memory) are
consistent.
🧹 Nitpick comments (1)
eo-runtime/src/main/eo/org/eolang/sprintf.eo (1)
87-89: Redundant re-initialization of position and argument index.Lines 87-88 re-initialize
posandarg-idxto 0, but they were already initialized to 0 at lines 19 and 21. Unless there's a specific reason for this reset (e.g., potential reuse concerns), these writes are unnecessary.Suggested simplification
- pos.write 0 - arg-idx.write 0 loop > @
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/sprintf.eo
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-17T14:21:45.092Z
Learnt from: h1alexbel
Repo: objectionary/eo PR: 4637
File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31
Timestamp: 2025-10-17T14:21:45.092Z
Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
Applied to files:
eo-runtime/src/main/eo/org/eolang/sprintf.eo
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: benchmark
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: trufflehog
- GitHub Check: qulice
- GitHub Check: ort
- GitHub Check: snippets
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: mvn (ubuntu-24.04, 17)
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: pr-size
- GitHub Check: integration
🔇 Additional comments (4)
eo-runtime/src/main/eo/org/eolang/sprintf.eo (4)
14-21: Initialization looks reasonable.The memory objects for tracking position, argument index, and result accumulation are properly initialized. The use of
bytesfor the initial empty result should work assuming the EO runtime supports empty bytes construction this way.
40-49: String formatting looks correct for string inputs.The
%shandler correctly usesval.as-byteswhich will produce the byte representation of string arguments. Note that unlike C's sprintf, there's no type checking—passing a non-string argument to%swould produce its raw byte representation rather than a formatted string.
22-86: Loop structure is sound but may have depth limitations.The recursive loop correctly increments
posin all branches, ensuring termination. However, for very long format strings, the recursive depth could become a concern depending on the EO runtime's stack limits.Additionally, there's a subtle edge case: if the format string ends with a single
%(e.g.,"test%"), the condition at line 31 (pos.lt (fmt.length.minus 1)) correctly prevents reading past the end, but the trailing%would be appended as a literal character (line 84), which matches standard sprintf behavior.
54-62: The runtime implementation ofsprintfuses Java'sString.format()method, not the pure EO code shown in sprintf.eo. The tests ineo-runtime/src/main/eo/org/eolang/tt/sprintf.eoconfirm that numeric formatting produces correct decimal string output (e.g., "14" for integer 14, "42.300000" for float 42.3). While the EO code usesas-int.as-bytesandas-float.as-bytes, the actual JVM implementation properly converts numbers to their decimal string representations. Note that numbers must be properly typed—for instance,sprintf("%d", 42.as-i64)requires conversion to42.as-i64.as-numberto work correctly.Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/sprintf.eo:
- Around line 78-84: The code attempts to call bytes with two separate arguments
("%" and spec) which is invalid; instead build a single bytes value by
concatenating "%" and spec before passing to bytes or by using an existing
concat operation. Replace the invalid bytes "%" spec expression inside the seq
-> result.write -> result.concat chain with a single bytes constructed from the
joined string (e.g., bytes (concat "%" spec) or bytes (spec.concat "%")
depending on available concat symbol), and keep the surrounding pos.write
(pos.plus 2) logic intact so result.write and pos.write still execute in
sequence.
- Around line 14-16: The object signature is malformed: change the signature
from "[sprintf] > sprintf" to accept fmt and args (for example "sprintf fmt args
> sprintf") so fmt and args are defined; then replace all occurrences of "@fmt"
with "fmt" and "@args" with "args" in this file (references include uses in
expressions around the sprintf object such as the occurrences noted on lines 26,
29, 33, 35, 45, 47, 58, 60, 71, 73) to ensure the transpiler sees the correct
attributes and the function uses the declared parameters.
- Around line 18-19: Replace the bare type reference used to initialize the
memory field named result in the memory object (the "memory > result"
initializer) with the concrete empty bytes literal `--`; specifically change the
initializer from the plain `bytes` reference to the empty bytes literal `--`
(and make the same change at the other occurrence noted), ensuring the
memory.result is initialized to `--` instead of the type symbol.
🧹 Nitpick comments (2)
eo-runtime/src/main/eo/org/eolang/sprintf.eo (2)
36-77: Limited format specifier support.The current implementation only handles
%%,%s,%d/%i, and%f/%F. Common specifiers like%x(hex),%o(octal),%c(char),%e(scientific notation), and width/precision modifiers are not supported.This is acceptable for an initial implementation, but consider documenting the supported specifiers and potentially tracking unsupported ones as future work.
Would you like me to open an issue to track adding support for additional format specifiers?
2-2: Movesprintfto thett(text transformation) package.
sprintfis a string formatting utility and belongs inorg.eolang.ttalongside other string operations likeslice,split,regex, andindex-of, not inorg.eolang.io. The correct implementation already exists ateo-runtime/src/main/eo/org/eolang/tt/sprintf.eowith packageorg.eolang.tt. Remove this duplicate or update its package declaration to match.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
eo-runtime/src/main/eo/org/eolang/sprintf.eo
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-17T14:21:45.092Z
Learnt from: h1alexbel
Repo: objectionary/eo PR: 4637
File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31
Timestamp: 2025-10-17T14:21:45.092Z
Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
Applied to files:
eo-runtime/src/main/eo/org/eolang/sprintf.eo
🪛 GitHub Actions: snippets
eo-runtime/src/main/eo/org/eolang/sprintf.eo
[error] 1-1: MjTranspile failed: java.lang.IllegalStateException: Failed to process 'org.eolang.sprintf' (org.eolang.maven.TjForeign). Transpile step aborted due to broken XMIR/Syntax in sprintf module.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: benchmark
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: qulice
- GitHub Check: mvn (ubuntu-24.04, 17)
- GitHub Check: trufflehog
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: pr-size
- GitHub Check: ort
🔇 Additional comments (1)
eo-runtime/src/main/eo/org/eolang/sprintf.eo (1)
24-91: Loop recursion pattern looks reasonable, pending syntax fixes.The recursive loop structure using a parameterless object
loopthat calls itself at line 88 is an appropriate pattern for EO iteration. The initialization ofposandarg-idxon lines 89-90 beforeloop > @on line 91 correctly sets up state before iteration begins.However, this will only work after the critical syntax issues (object signature on line 14, bytes construction on lines 81-83) are resolved.
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Fix all issues with AI agents
In @eo-runtime/src/main/eo/org/eolang/io/sprintf.eo:
- Around line 23-28: The inner object formatted-with incorrectly declares a
parameter named fmt that shadows the outer fmt and its apply simply returns fmt
without formatting; rename the inner parameter (e.g., remove the inner [fmt] or
rename it to something like [vals]) so it no longer shadows the outer fmt,
update apply in formatted-with to actually use the outer fmt together with its
vals to perform formatting (or, if the real implementation is provided in Java,
replace the stub body with a clear TODO comment and a descriptive placeholder
log/return), and ensure the unique symbols formatted-with, apply, and fmt are
updated accordingly to reflect the corrected parameter and intent.
- Around line 30-35: The test invocation passes three separate args to apply but
apply is declared with a single parameter `[vals] > apply`; fix by passing a
single aggregate that matches the `vals` parameter (e.g., call apply with a
single list containing "test", "arg1", "arg2") or alternatively change the
signature of `apply` to accept multiple positional parameters if intended;
update `test-simple` so it either invokes `apply` with one list value or adjust
the `apply` declaration accordingly (refer to `apply` and `test-simple` in the
diff).
- Around line 17-21: The object uses an undeclared variadic parameter and calls
a non-existent method on the format string; declare the variadic parameter in
the parameter list (e.g., change `[fmt] > sprintf` to include `args...` like
`[fmt, args...] > sprintf`), remove the incorrect `fmt.formatted-with values`
call, and delegate to the aliased implementation `org.eolang.txt.sprintf` by
calling that aliased symbol with `fmt` and the variadic `args...` instead; also
rename the alias on line 1 to a distinct name to avoid shadowing/confusion with
the current `sprintf`.
In @eo-runtime/src/main/eo/org/eolang/tt/sprintf.eo:
- Around line 29-30: The inline invocation of sprintf is broken because its
arguments are split across lines; change the call so all arguments are on the
same line (e.g., place "%x" and 42.as-bytes together after sprintf) or convert
to a multi-argument form using tuple expansion, ensuring the sprintf invocation
(symbol: sprintf) receives "%x" and the result of 42.as-bytes on the same
invocation line rather than on separate lines.
- Around line 68-69: The sprintf invocation is split across two lines (the call
on sprintf and its arguments on the next line), breaking the inline invocation;
fix it by placing the arguments ("This is the %s; This is the %1$s as well; The
%s; and the %d" "first" "second" 3) on the same line as the sprintf call (or
otherwise use the language's explicit continuation syntax) so the sprintf
invocation is a single inline expression and the arguments remain attached to
the sprintf call.
- Around line 35-37: The inline call to sprintf has its format string and
arguments on separate lines which breaks EO parsing; fix by placing the format
string and its arguments in the same invocation (e.g., make the entire sprintf
call a single line) or use EO's multi-line tuple form by prefixing the argument
list with * so the call becomes a valid multi-line invocation; update the call
to the sprintf function (the sprintf invocation on line with "sprintf")
accordingly.
- Around line 55-56: The sprintf invocation has its argument split across lines
— the call should be inline so the argument `42.as-i64.as-number` is on the same
expression as `sprintf "%d"`; fix by joining them into a single inline
invocation (e.g. `sprintf "%d" 42.as-i64.as-number`) so the parser treats
`42.as-i64.as-number` as the argument to sprintf.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
eo-runtime/src/main/eo/org/eolang/io/sprintf.eoeo-runtime/src/main/eo/org/eolang/tt/sprintf.eo
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-17T14:21:45.092Z
Learnt from: h1alexbel
Repo: objectionary/eo PR: 4637
File: eo-parser/src/main/resources/org/eolang/parser/parse/resolve-compacts.xsl:27-31
Timestamp: 2025-10-17T14:21:45.092Z
Learning: In the EO language aliasing system, only concrete objects (complete paths to objects, e.g., `org.eolang.io.stdout`) can be aliased, not intermediate packages or partial paths (e.g., `org.eolang.io`). This means aliases always point to final objects, not package prefixes.
Applied to files:
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
🪛 GitHub Actions: integration
eo-runtime/src/main/eo/org/eolang/tt/sprintf.eo
[error] 37-37: Failed to parse: Invalid bound object declaration at line 37.
[error] 35-35: Failed to parse: extraneous input 'TAB' expecting {...} at line 35.
[error] 35-35: Failed to parse: no viable alternative at input for line 35.
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo
[error] 18-18: Invalid object declaration
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: qulice
- GitHub Check: pr-size
- GitHub Check: benchmark
- GitHub Check: ort
- GitHub Check: mvn (windows-2022, 23)
- GitHub Check: trufflehog
- GitHub Check: mvn (ubuntu-24.04, 23)
- GitHub Check: mvn (macos-15, 23)
- GitHub Check: mvn (ubuntu-24.04, 17)
- GitHub Check: snippets
🔇 Additional comments (2)
eo-runtime/src/main/eo/org/eolang/tt/sprintf.eo (1)
17-17: Correctly formatted inline invocations.These test cases use proper single-line inline invocation syntax and should work correctly once the other tests are fixed.
Also applies to: 23-23, 43-43, 49-49, 62-62, 74-75
eo-runtime/src/main/eo/org/eolang/io/sprintf.eo (1)
1-7: Verify the design intent and relationship with eo-strings.The file aliases
org.eolang.txt.sprintffrom theeo-stringsdependency but then defines a neworg.eolang.io.sprintfobject. It's unclear whether this is meant to:
- Wrap/re-export the txt.sprintf
- Provide a different implementation
- Be a migration shim
Please clarify the intended design. Based on learnings, EO aliases point to concrete objects, so
org.eolang.txt.sprintfshould be the actual implementation from eo-strings.
#4752
sprintf implementation
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.