cf-tool
cf-tool copied to clipboard
Improvements to the code structure
Hey @xalanq I wanted to contribute to this project, but upon inspection, I noticed a lot of repetitions and redundancies in the code. Also, lack of comments and disorganized code structure made it difficult for me to add changes while maintaining readability of the code.
So, I've decided to rewrite the entire tool in golang
with the following improvements.
- Neatly structured code, with detailed comments and documentation on role of each package/folder in the repo. This will encourage more people to contribute.
- A more comprehensive use of the codeforces API. This will ensure that changes in the website won't affect the tool (provided API doesn't change too). Also, instead of scraping different pages for different use cases, data from a single API request can be used.
- An API framework for the tool. Third party tools (like the new CP editor) can then send requests to this tool and get responses back in JSON. This would mean people can now make extensions for tools like sublime and VSCode easily.
- Few commands will be merged or removed (e.g.
parse
/race
andpull
/clone
) and new commands will be added (e.g. list contests and register for them, compare real-time contest standings with friends)
Once I completely finish the code, I'll make a pull request to this tool (as I don't intend to make another tool with the same features)
For now, you can view the code and work in my repo and suggest changes (or make pull requests if possible). Note that, apart from a few lines of documentation in /docs
folder, there isn't much information (the codes however have well written comments).
I'd be glad to know if you're open to (this form of) contribution of mine.
@ouuan Your suggestions regarding API functionality and requirements would be appreciated.
@ouuan Your suggestions regarding API functionality and requirements would be appreciated.
Thanks in advance!
I thought of requesting for some API, but the current solution just works, so I decided not to bother xalanq and other contributors.
Here are some suggestions:
-
Now CF Tool output to the command line, and when the result is updated, only a part of the outputs are updated, so I can't get the complete output from the new output. I want to get the complete information of the submission verdict when it's updated, possibly with colors in plain text (let the clients to render to color).
-
Make it able to set a single part of a template, instead of the whole long process of
cf config 1
. -
#79.
@ouuan
- Make it able to set a single part of a template, instead of the whole long process of
cf config 1
.
You can edit the config file directly (JSON is easy to understand).
You can edit the config file directly (JSON is easy to understand).
I'm not asking how to change a single config manually.
I mean it's better to have an API to do this, I can call this API in other applications.
Update. I've nearly completed migrating all existing features (with multiple modifications made) to the new tool. See (an almost similar demo gif) below.
https://github.com/infixint943/cf/raw/master/assets/demo.gif
Here's an update. I've nearly completed migrating all features of the current tool to a more organised project structure in my repo.
Also, since the author seems to not be maintaining this project currently, I feel the need to maintain my own version of the tool, and NOT make a PR (actually, I've had some plans to expand this project, making similar CLI tools for other major online judges too). I plan on actively maintaining the project (and progressing with the above idea) so any contributors / contributions are appreciated.
Let me know in the comments, what you think of this plan