feat(config): add prefix and default suffix

Extend the configuration with ‹prefix› and ‹language.default_suffix›.

• ‹prefix› -- specifies the content of the first comment in the review
• ‹language.default_suffix› -- specifies the extension of the sources
  where the prefix is being added

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2022-10-15 15:39:21 +02:00
parent f7a7f65ecd
commit a869a3ebf8
Signed by: mfocko
GPG Key ID: 7C47D46246790496
5 changed files with 34 additions and 4 deletions

View File

@ -7,4 +7,5 @@ language:
on_separate_line: true
opening: "/** "
continuation: " ** "
closing: "\n **/\n"
closing: "\n **/\n"
default_suffix: "hpp"

View File

@ -7,4 +7,5 @@ language:
on_separate_line: false
opening: "-- # "
continuation: "-- # "
closing: "\n"
closing: "\n"
default_suffix: "hs"

View File

@ -7,4 +7,21 @@ language:
on_separate_line: false
opening: "## "
continuation: "## "
closing: "\n"
closing: "\n"
default_suffix: "py"
prefix: |
Hodnotenie: @
---
[ ] jasně popisuje řešení zadaného problému
[ ] je správně dekomponované na podproblémy
[ ] je zapsáno bez zbytečného opakování
[ ] používá správné abstrakce, algoritmy a datové struktury
+ = OK, - = zanedbatelne nedostatky, X = vyrazne nedostatky
Summary (+1s, suggestions, rants, confessions, etc.):
Pokial Vam nieco nie je jasne alebo sa chcete pobavit o nejakom lepsom napade
na riesenie => mail || Discord || konzultacie

View File

@ -15,4 +15,11 @@ language:
# sequence that is used for multiline comments, i.e. prefixing the lines
continuation: " ** "
# sequence that closes off the comment, including newline
closing: "\n **/\n"
closing: "\n **/\n"
# suffix of the file where header of review is added
default_suffix: "c"
# prefix is used to put initial comment into every file
# can be used for final grade that must appear on the first line
prefix: |
comment that appears at the beginning of each solution

View File

@ -13,12 +13,16 @@ type Config struct {
Repository string `yaml:"repository"`
Token string
} `yaml:"gitea"`
Language struct {
OnSeparateLine bool `yaml:"on_separate_line"`
Opening string `yaml:"opening"`
Continuation string `yaml:"continuation"`
Closing string `yaml:"closing"`
DefaultSuffix string `yaml:"default_suffix"`
} `yaml:"language"`
Prefix string `yaml:"prefix"`
}
func LoadConfig(config *Config, filename string) {