Skip to content

Conversation

@gai93003
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@gai93003 gai93003 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 2, 2025
@LonMcGregor LonMcGregor added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 12, 2025
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.

Great work implementing these tasks. I have some small comments on ways you could improve them further.

for (const line of lines) {
if (options.b) {
if (line.trim() !== "") {
console.log(`${(lineNum).toString().padStart(6)} ${line}`);

Choose a reason for hiding this comment

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

Here is looks like there is some repetition of code across your different output options. Can you think of a way to clean this up?

const filtered = content.filter((word) => word.charAt(0) !== '.')

if (opts.one) {
console.log(filtered.join('\n'))

Choose a reason for hiding this comment

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

What happens if you run the original ls command with both -a1 options? How does this compare to your implementation?

totalChars += chars;

let output = '';
if (opts.l) output += `${lines} `;

Choose a reason for hiding this comment

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

There is quite a bit of duplication in your printing here and where you do total output. Can you think of a way to make this code cleaner?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 12, 2025
@gai93003 gai93003 added the Complete Volunteer to add when work is complete and all review comments have been addressed. label Jan 12, 2026
@github-actions
Copy link

Your PR description contained template fields which weren't filled in.

Check you've ticked everything in the self checklist, and that any sections which prompt you to fill in an answer are either filled in or removed.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

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. Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants