robotpy / pyfrc

python3 library designed to make developing RobotPy-based code easier!
MIT License
50 stars 35 forks source link

Added a check for the correct robot.py capitalization. #187

Closed benjiboy50fonz closed 2 years ago

benjiboy50fonz commented 3 years ago

In response to robotpy/robotpy-installer#110, I propose a solution.

Because os.listdir offers a list of directory contents, and we have a specific file we want to search for, I simply added a check to see if robot.py was in the directory which called the deploy command. If it's not, it assumes incorrect capitalization and fails.

I did it this way as well to prevent programmers from intentionally naming their file "Robot.py", and then encountering issues down the road. Hopefully this cuts them short, and gives them enough clarity that they can modify their codebase to meet this naming standard.

Criticism is very welcome!

benjiboy50fonz commented 3 years ago

I was very behind on my commits it seems; how unfortunate.

auscompgeek commented 3 years ago

I'm pretty sure we already have a check for robot.py that's overridable. We need to improve that check, not break that entirely.

benjiboy50fonz commented 3 years ago

The check is still present.

auscompgeek commented 3 years ago

Sure, but what I'm saying is that this check and that check seem to be completely separate. That breaks the intent of the override, I think.

virtuald commented 3 years ago

@benjiboy50fonz have you actually tested this PR? As @auscompgeek pointed out I don't think this is doing what you intended.

benjiboy50fonz commented 3 years ago

Ok, I understand @auscompgeek . @virtuald, I haven't had access to my RIO yet, but I will soon. I'd set up a VM, but I'm on Windows and WSL is a pain, as well as a VM in a VM.

virtuald commented 3 years ago

It's generally a bad idea to make changes to code without testing those changes.

virtuald commented 2 years ago

... so what's going on with this?

virtuald commented 2 years ago

This is a fine idea, but it needs to actually work if we're going to accept it.