Skip to content

Conversation

@jhill1
Copy link
Owner

@jhill1 jhill1 commented Apr 28, 2025

Nice work! The code is easy to read and understandable with good comments.

To improve further:

  1. Make commit atomic and functional, unless it's clear it for swapping computers or end of day (etc).
  2. Try not to hard code thing (the python_cmd), as that only then works on your computer. Instead an an optional argument which has a sensible default (.e.g $HOME/AppData...)
  3. Don't turn off all linting options - you can ignore a line or range of lines and specific lints: https://rdrr.io/cran/lintr/man/exclude.html

Great stuff, well done.

Copy link
Owner Author

Choose a reason for hiding this comment

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

This is an odd commit! Seems to have deleted the whole file and then replaced it with one extra line...Check what is to be commit with git diff and unwind if needed.

R/todo.R Outdated

tasks <- readLines(TASK_FILE)
}
print(tasks)
Copy link
Owner Author

Choose a reason for hiding this comment

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

Try not to commit testing chnages

R/todo.R Outdated

#remember to change where .tasks is going
list_tasks <- function() {
counter <- 1
Copy link
Owner Author

Choose a reason for hiding this comment

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

Nice!

R/todo.R Outdated
tasks <- readLines(TASK_FILE)
for (item in tasks) {
output_string <- paste(output_string, counter, item)
output_string <- paste(output_string, counter, item, "\n" )
Copy link
Owner Author

Choose a reason for hiding this comment

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

This doesn't match the commit message...

counter <- 1
output_string <- ""
tasks <- readLines(TASK_FILE)
num_tasks <- length(tasks)
Copy link
Owner Author

Choose a reason for hiding this comment

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

Good. Make the commit message something more like "List_tasks function complete and passing test", as the current message is vague

R/todo.R Outdated
remove_task <- function(index) {

tasks <- readLines(TASK_FILE)
task_removed <- tasks[-1]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Don't commit temporary stuff unless you're switching computers and need to push

R/todo.R Outdated


main <- function(args) {
#main <- function(args) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Don't commit commented out code, even temporarily.

tasks <- readLines(TASK_FILE)
if (index < length(tasks))
tasks <- tasks[-index]
if (length(tasks) == 0) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Good!

library(argparse)
})


Copy link
Owner Author

Choose a reason for hiding this comment

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

use # nolint to not lint a line (e.g. line 14). You should be able to return null or NA

@jhill1
Copy link
Owner Author

jhill1 commented Apr 28, 2025

@kkx504 COmmetns above and inline. Nice work!

@jhill1 jhill1 closed this Apr 28, 2025
@jhill1 jhill1 reopened this May 1, 2025
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.

2 participants