Skip to content

Glasgow | 25-SDC-NOV | Katarzyna Kazimierczuk | Sprint 3 | Implement Shell Tools#324

Open
katarzynakaz wants to merge 4 commits intoCodeYourFuture:mainfrom
katarzynakaz:implement-shell-tools-fixed
Open

Glasgow | 25-SDC-NOV | Katarzyna Kazimierczuk | Sprint 3 | Implement Shell Tools#324
katarzynakaz wants to merge 4 commits intoCodeYourFuture:mainfrom
katarzynakaz:implement-shell-tools-fixed

Conversation

@katarzynakaz
Copy link
Copy Markdown

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

Changelist

js tools.

@katarzynakaz katarzynakaz 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 Feb 7, 2026
@katarzynakaz katarzynakaz changed the title Glasgow | 25-SDC-NOV | Katarzyna Kazimierczuk | Sprint 3 | Implement Shell Tools Glasgow | 25-SDC-NOV | Katarzyna Kazimierczuk | Sprint 4 | Implement Shell Tools Feb 7, 2026
@katarzynakaz katarzynakaz added 📅 Sprint 4 Assigned during Sprint 4 of this module and removed 📅 Sprint 3 Assigned during Sprint 3 of this module labels Feb 8, 2026
@SlideGauge SlideGauge added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Feb 15, 2026
Copy link
Copy Markdown

@SlideGauge SlideGauge left a comment

Choose a reason for hiding this comment

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

General note: I notced async/await being used here, I have doubts in necessity of it in this context: we're doing a console utility

Comment thread implement-shell-tools/cat/index.js Outdated
Comment thread implement-shell-tools/cat/notes.js Outdated
Comment thread implement-shell-tools/cat/index.js Outdated
Comment thread implement-shell-tools/cat/index.js Outdated
Comment thread implement-shell-tools/ls/index.js Outdated
Comment thread implement-shell-tools/cat/index.js Outdated
Comment thread implement-shell-tools/wc/index.js Outdated
Comment thread implement-shell-tools/wc/index.js Outdated
@SlideGauge SlideGauge 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 Feb 15, 2026
@katarzynakaz
Copy link
Copy Markdown
Author

katarzynakaz commented Feb 22, 2026

Thank you for the feedback. I was folllowing the coursework in Sp 4 with the use of async / await but I see your point.
Changes implemented :)

@katarzynakaz katarzynakaz added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 22, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 22, 2026
@katarzynakaz katarzynakaz added 📅 Sprint 3 Assigned during Sprint 3 of this module and removed 📅 Sprint 4 Assigned during Sprint 4 of this module labels Feb 22, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@katarzynakaz katarzynakaz changed the title Glasgow | 25-SDC-NOV | Katarzyna Kazimierczuk | Sprint 4 | Implement Shell Tools Glasgow | 25-SDC-NOV | Katarzyna Kazimierczuk | Sprint 3 | Implement Shell Tools Feb 22, 2026
@github-actions

This comment has been minimized.

@katarzynakaz katarzynakaz added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 22, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 22, 2026
@katarzynakaz katarzynakaz added 📅 Sprint 4 Assigned during Sprint 4 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 22, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 22, 2026
@katarzynakaz katarzynakaz added ⚙️ bug Something isn't working NotCoursework Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed 📅 Sprint 4 Assigned during Sprint 4 of this module ⚙️ bug Something isn't working labels Feb 22, 2026
Copy link
Copy Markdown
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

A lot of the pieces here are looking good, but the solutions often aren't very general - can you take a look at these comments? Thanks!

Comment on lines +14 to +15
async function showVisibleInSampleFiles() {
const listOfFiles = await fs.readdir("sample-files");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We generally don't want to hard-code that our program only works with specific directories - can you think how to make this more general? And how to make it share code with the other two functions?


if (argv.includes("-l")) {
await countLines(files);
} else if (argv.includes("-w")) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The real wc also supports passing multiple of the flags at once (e.g. wc -w -l /some/file), and does something a bit different if you pass multiple files (wc -w -c /some/file /some/other/file) - can you see if you can match those behaviours?


// * `wc -l sample-files/3.txt`
// * `wc -l sample-files/*`
async function countLines(listOfFiles) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These functions are quite repetitive with each other.

import process from "node:process";
import { promises as fs } from "node:fs";

//from coursework
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove the assorted commented out code :)

if (file === "") {
console.log("");
} else {
console.log(`${countingOnlyFullLines} ${file}`);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These ifs are quite repetitive, which has a couple of issues:

  1. When reading the code, it's hard to see which parts are the same across the branches, and what parts are different.
  2. In the future if we add new concerns (e.g. a "colour every other line" flag), we'll need to implement that across each of the branches.

We often solve this by separating "the differences" from "what's the same", e.g.

// Make a variable up-front:
let prefix = "";
// Conditionally change things
if (something) {
  prefix = "hello";
} else if (somethingElse) {
  prefix = "goodbye";
}
console.log(`${prefix}${line}`);

So that the ifs at the start make clear how things are different, and what comes after shows what's the same/different

@illicitonion illicitonion removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. NotCoursework labels May 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

The changed files in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the changed files tab at the top of the page, we are only expecting changes in this directory: ^implement-shell-tools/

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.

1 similar comment
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

The changed files in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the changed files tab at the top of the page, we are only expecting changes in this directory: ^implement-shell-tools/

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please can you remove these .DS_Store files from your branch? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants