Skip to content

Conversation

@fatmaevin
Copy link

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

@fatmaevin fatmaevin added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Dec 1, 2025
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jan 14, 2026
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Good start on these tasks

Remember to add a short summary to your PRs under the template, so I know what it is you have done.

See also my comments in the files

const read = await fs.readFile(path, "utf-8");
const lines = read.split("\n");
for (let i of lines) {
if (number) {

Choose a reason for hiding this comment

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

This section has some repetition - two print formats, and two "print a number"s. The nested ifs are also a bit difficult to read. Can you think of any way to tidy this up?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for feedback

I created a new function to handle the repeated parts.

if (opts.w) return `${counts.words} ${filename}`;
if (opts.c) return `${counts.bytes} ${filename}`;

return `${counts.lines} ${counts.words} ${counts.bytes} ${filename}`;

Choose a reason for hiding this comment

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

If I request multiple files using *, the numbers dont format into columns. Can you figure out why that happens?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the feedback
I used padStart() to align the numbers in columns .

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jan 14, 2026
@fatmaevin fatmaevin added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jan 20, 2026
@LonMcGregor
Copy link

Great work!

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants