-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: head comments #39
Conversation
CompetiTest can be configured to create source files from templates for received problems and contests, see Regarding new modifiers, they should be kept separated from file format modifiers. We already discussed about I suggest the following receive-modifers, that will be used to evaluate
@D4NZ-jpg wait before proceeding with commits until we reach an agreement about what to do |
Now that #40 is closed and receive modifiers (previously called comment modifiers) are implemented, you should rebase this PR or make it from scratch (don't worry, it'll be easier). Here are some suggestions:
|
Got it. Will make the changes soon. |
@xeluxee done, does everything seems okay? |
This PR looks ready to be merged |
Great, thanks! |
I've added this new feature that I personally find really neat to keep track of my solutions, and I think it could benefit others too.
The idea behind this feature is to provide users with the ability to add a header comment at the start of each file automatically. This feature is useful for adding metadata about the problem such as the problem name, group, URL, memory limit, time limit and the starting time.
If you decide to add a comment, you can use specific modifiers to insert dynamic information. For example, you can set the
head_comment
variable to "//This file was generated at $(TIME)
", and it will automatically insert the current time in your preferred format, which can be specified with thetime_format
option, which allows you to specify how you'd like to display the time in your header comment.This feature is not mandatory; if you don't want a comment in your files, just set the
head_comment
variable tofalse
.The way I like to use it is something like this:
which produces something like this on the top of every file: