Skip to content

Conversation

@UdeshyaDhungana
Copy link
Contributor

@UdeshyaDhungana UdeshyaDhungana commented Nov 11, 2025

Note

Introduce a new highlighting extension to the grep course with five stages and detailed stage descriptions; also ignore .DS_Store.

  • Course definition (course-definition.yml):
    • Add new extension: highlighting with description and ANSI escape code references.
    • Add stages under highlighting:
      • bm2: Highlighting a single match
      • eq0: Highlighting multiple matches
      • jk4: Disabling highlighting (--color=never)
      • na5: Auto highlighting option (--color=auto with TTY detection)
      • nd0: Default behavior equals auto when --color absent
  • Stage descriptions:
    • Add stage_descriptions/highlighting-01-bm2.md, -02-eq0.md, -03-jk4.md, -04-na5.md, -05-nd0.md with examples, tests, and notes for each stage.
  • Misc:
    • Update .gitignore to ignore /.DS_Store (macOS).

Written by Cursor Bugbot for commit b6278c6. This will update automatically on new commits. Configure here.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions
Copy link

github-actions bot commented Nov 12, 2025

LLM Doc Lint

56 tests   53 ✅  0s ⏱️
 4 suites   0 💤
 1 files     3 ❌

For more details on these failures, see this check.

Results for commit f3af72b.

♻️ This comment has been updated with latest results.

@UdeshyaDhungana
Copy link
Contributor Author

The line printing stage has been removed, and has been incorporated into this extension: #179

@github-actions
Copy link

github-actions bot commented Nov 14, 2025

LLM Doc Lint

70 tests   65 ✅  0s ⏱️
 5 suites   0 💤
 1 files     5 ❌

For more details on these failures, see this check.

Results for commit bdfe1fb.

♻️ This comment has been updated with latest results.

<code>$ echo -n "I have 3 cows" | grep --color=auto -E 'cows'
I have <span style="font-weight:bold;color:red">3</span> cows
$ echo -n "I have 4 cows" | grep --color=auto -E 'cows' >> /dev/tty
I have <span style="font-weight:bold;color:red">3</span> cows</code>
Copy link

Choose a reason for hiding this comment

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

Bug: Output Mismatch: Highlighting and Value

The example shows the pattern 'cows' being matched, but the highlighted text in the output is the digit 3 instead of the word cows. Additionally, the second command uses input "I have 4 cows" but the output incorrectly shows 3 instead of 4. The highlighting should be on cows in both outputs, and the second output should display 4.

Fix in Cursor Fix in Web

$ echo -n "I have 3 horses" | grep --color=auto -E '\d' >> file.txt

# Piping to another command
$ echo -n "He has 9 rabbits" | grep --color=auto -E '\d' | another_command
Copy link

Choose a reason for hiding this comment

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

Bug: Default behavior tests are not truly default.

The test examples incorrectly include --color=auto flag when testing the default behavior. This stage is about testing grep's default behavior when the --color flag is not present, so these test commands should omit the --color=auto flag entirely to properly test the default behavior.

Fix in Cursor Fix in Web

@github-actions
Copy link

github-actions bot commented Nov 14, 2025

LLM Doc Lint

70 tests   66 ✅  0s ⏱️
 5 suites   0 💤
 1 files     4 ❌

For more details on these failures, see this check.

Results for commit ec8cd19.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Nov 14, 2025

LLM Doc Lint

70 tests   66 ✅  0s ⏱️
 5 suites   0 💤
 1 files     4 ❌

For more details on these failures, see this check.

Results for commit e9f4865.

♻️ This comment has been updated with latest results.

@@ -0,0 +1,90 @@
In this stage, you'll add support for highlighting the matched text in your grep implementation.

### Highlighting the matched text
Copy link
Member

Choose a reason for hiding this comment

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

Now that we have the prerequisites, let's change the ordering here:

  • Highlighting a single match
  • Highlighting multiple matches
  • Disabling highlighting
  • Auto highlighting behaviour (not sure about this name, could be improved)
  • Default highlighting behaviour (not sure about this name, could be improved)

@github-actions
Copy link

github-actions bot commented Nov 17, 2025

LLM Doc Lint

70 tests   66 ✅  0s ⏱️
 5 suites   0 💤
 1 files     4 ❌

For more details on these failures, see this check.

Results for commit b6278c6.

♻️ This comment has been updated with latest results.

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.

3 participants