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

Fix tab character handling ( if ignore the tab character, do not increment the column number ) #676

Merged
merged 3 commits into from
Mar 16, 2025

Conversation

goccy
Copy link
Owner

@goccy goccy commented Mar 16, 2025

fix #675

@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.85%. Comparing base (9671363) to head (4cfa363).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #676   +/-   ##
=======================================
  Coverage   77.84%   77.85%           
=======================================
  Files          22       22           
  Lines        7959     7962    +3     
=======================================
+ Hits         6196     6199    +3     
  Misses       1350     1350           
  Partials      413      413           
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@goccy goccy requested a review from Copilot March 16, 2025 04:13

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes tab character handling so that when a tab is ignored, the column number is not incremented. Key changes include:

  • Adding new test cases in parser_test.go to verify correct handling of tab characters.
  • Introducing a new progressOnly function in scanner/scanner.go.
  • Replacing progressColumn calls with progressOnly in tab-related code paths in scanner/scanner.go to adjust column behavior.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
parser/parser_test.go New test cases for YAML content with tab characters to verify fix
scanner/scanner.go Adds progressOnly and updates scan logic to adjust tab character handling
Comments suppressed due to low confidence (2)

scanner/scanner.go:101

  • [nitpick] The function name 'progressOnly' is ambiguous—its purpose of selectively updating state (offset without affecting column) is not immediately clear. Consider adding a comment or choosing a more descriptive name to clarify its intent.
func (s *Scanner) progressOnly(ctx *Context, num int) {

scanner/scanner.go:1444

  • Replacing progressColumn with progressOnly should avoid incrementing the column number, however, since progressOnly still calls progress (which may update column-related state), please double-check that the column is not inadvertently incremented in these cases.
s.progressOnly(ctx, 1)
@goccy goccy merged commit 100fa23 into master Mar 16, 2025
20 checks passed
@goccy goccy deleted the fix-675 branch March 16, 2025 04:53
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.

Tabs before colons in keky:values are rejected, but only sometimes
2 participants