You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ruby args regex: do|...|/{|...|} block-parameter fallback isn't scoped to define_method, misattributes an unrelated iterator block inside a paren-less def's body #2241
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginethreat: false-positiveAccuracy tuning: Engine incorrectly flagged safe code
gitgalaxy/standards/language_standards.py's ruby args rule has 4 alternatives in one pattern: a real def name(...) parameter list, OR a do |...| block, OR a { |...| } block, OR a -> (...) lambda — intended so define_method(:x) do |a,b| ... end (no def(...) at all) still gets a real arg count. But the match isn't scoped to require the block be the method's own define_method-style body; it's found via a search/finditer over the whole method body, so it matches the first unrelated enumerator block deep inside a normal, paren-less def and misattributes that block's own parameter as the method's own argument count.
Confirmed examples (all in rails/*.rb), each a genuinely zero-argument method whose body happens to contain an ordinary iterator block:
deftouch_attachmentsattachments.thendo |relation| # <- GitGalaxy reads this as touch_attachments' own arg (=1)
...
defadd_digestsassets_files.eachdo |asset| # <- same misattribution
...
Also affects: mail, generate_guides, guides_to_generate, copy_assets. tree-sitter and ctags both correctly report 0 args for all six; GitGalaxy alone reports 1.
Suggested fix: scope the do|...|/{|...|} fallback alternative so it only matches when the block is the method's own body-opening construct (e.g. immediately following the method name with no def/parens at all — the actual define_method(:x) do |...| shape), not any block found anywhere inside an already-def-declared method's body.
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginethreat: false-positiveAccuracy tuning: Engine incorrectly flagged safe code
Activity
docs: full tri-comparison ledger sweep -- 49 shapes resolved, 0 unval…
fix(typescript): recognize negation-body arrows, optional method sign…
fix(ruby): scope block-parameter args fallback to define_method's own…