Skip to content

London | 26-SDC-Mar | Khilola Rustamova| Sprint 4 |Implement shell tools python#537

Open
HilolaRustam wants to merge 10 commits into
CodeYourFuture:mainfrom
HilolaRustam:implement-shell-tools-python
Open

London | 26-SDC-Mar | Khilola Rustamova| Sprint 4 |Implement shell tools python#537
HilolaRustam wants to merge 10 commits into
CodeYourFuture:mainfrom
HilolaRustam:implement-shell-tools-python

Conversation

@HilolaRustam

@HilolaRustam HilolaRustam commented Jun 10, 2026

Copy link
Copy Markdown

Learners, PR Template

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

implementation of cat, ls and wc with python

@HilolaRustam HilolaRustam added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Tools The name of the module. 📅 Sprint 3 Assigned during Sprint 3 of this module labels Jun 10, 2026
@illicitonion illicitonion 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 Jun 10, 2026

@illicitonion illicitonion left a comment

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.

This is generally looking good, and like things work :) I left a few style comments, and many of my comments to one project apply to the others as well.

Comment thread implement-shell-tools/cat/mycat.py Outdated
Comment thread implement-shell-tools/cat/mycat.py
Comment thread implement-shell-tools/cat/mycat.py Outdated
Comment thread implement-shell-tools/cat/mycat.py Outdated
Comment thread implement-shell-tools/cat/mycat.py Outdated
Comment thread implement-shell-tools/cat/mycat.py Outdated
Comment thread implement-shell-tools/ls/my-ls.py Outdated
@illicitonion illicitonion 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 Jun 10, 2026
@HilolaRustam HilolaRustam added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jun 11, 2026

@illicitonion illicitonion left a comment

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.

This looks really good, well done!

Comment on lines +17 to +26
for a in args:
if a == "-n":
number_all = True
elif a == "-b":
number_nonempty = True
else:
paths.append(a)

if number_nonempty:
number_all = False

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.

This kind of relationship where different options/states are related but exclusive can be hard to follow. (Here, it should never be the case that number_all and number_nonempty are both True - it's an invalid state in the program).

Instead of this, we sometimes use enums for this (or can use strings as enums). Consider a single variable number_mode which could be set to either "none", "non_empty" or "all" - here we don't need to think about what both True mean - we just have one variable which could have one of three variables. What do you think about this?

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.

I don't think you addressed this comment?

Comment thread implement-shell-tools/wc/my-wc.py Outdated
Comment thread implement-shell-tools/wc/my-wc.py Outdated
@illicitonion illicitonion changed the title London | 26-SDC-Mar | Khilola Rustamova| Sprint 3 |Implement shell tools python London | 26-SDC-Mar | Khilola Rustamova| Sprint 4 |Implement shell tools python Jun 11, 2026
@illicitonion illicitonion 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. labels Jun 11, 2026
@HilolaRustam HilolaRustam added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jun 15, 2026
@illicitonion illicitonion removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 17, 2026

@illicitonion illicitonion left a comment

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.

This is generally looking really good - just a couple of last things :)

sys.exit(1)


def expand_paths(paths):

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.

You shouldn't need to do this expansion in your program; the shell should do it for you.

Comment on lines +17 to +26
for a in args:
if a == "-n":
number_all = True
elif a == "-b":
number_nonempty = True
else:
paths.append(a)

if number_nonempty:
number_all = False

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.

I don't think you addressed this comment?

@illicitonion illicitonion added the Reviewed Volunteer to add when completing a review with trainee action still to take. label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Tools The name of the module. 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.

2 participants