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

@ -8,3 +8,4 @@ language:
opening: "/** " opening: "/** "
continuation: " ** " continuation: " ** "
closing: "\n **/\n" closing: "\n **/\n"
default_suffix: "hpp"

View file

@ -8,3 +8,4 @@ language:
opening: "-- # " opening: "-- # "
continuation: "-- # " continuation: "-- # "
closing: "\n" closing: "\n"
default_suffix: "hs"

View file

@ -8,3 +8,20 @@ language:
opening: "## " opening: "## "
continuation: "## " 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

@ -16,3 +16,10 @@ language:
continuation: " ** " continuation: " ** "
# sequence that closes off the comment, including newline # 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"` Repository string `yaml:"repository"`
Token string Token string
} `yaml:"gitea"` } `yaml:"gitea"`
Language struct { Language struct {
OnSeparateLine bool `yaml:"on_separate_line"` OnSeparateLine bool `yaml:"on_separate_line"`
Opening string `yaml:"opening"` Opening string `yaml:"opening"`
Continuation string `yaml:"continuation"` Continuation string `yaml:"continuation"`
Closing string `yaml:"closing"` Closing string `yaml:"closing"`
DefaultSuffix string `yaml:"default_suffix"`
} `yaml:"language"` } `yaml:"language"`
Prefix string `yaml:"prefix"`
} }
func LoadConfig(config *Config, filename string) { func LoadConfig(config *Config, filename string) {