[config]Support config license header comment style.#97
[config]Support config license header comment style.#97kezhenxu94 merged 12 commits intoapache:mainfrom
Conversation
|
Hi skywalking-eyes community, I don't understand why the project CI failure, who can help me, Thanks. |
pkg/config/config.go
Outdated
| package config | ||
|
|
||
| import ( | ||
| "github.com/apache/skywalking-eyes/pkg/comments" |
There was a problem hiding this comment.
@dongzl Please move this to line 25 and this should fix your lint, try run gofmt -s -w pkg/config/config.go to fix it automatically. Just a formatting issue compaint by the CI.
There was a problem hiding this comment.
@dongzl Please move this to line 25 and this should fix your lint, try run
gofmt -s -w pkg/config/config.goto fix it automatically. Just a formatting issue compaint by the CI.
@Superskyyy It's OK, Thanks very much.
|
@kezhenxu94 Please take a look. |
kezhenxu94
left a comment
There was a problem hiding this comment.
IT's better to merge the user-configured settings with the default ones (
skywalking-eyes/pkg/comments/config.go
Line 55 in eb0e0b0
fix logic.
pkg/config/config.go
Outdated
| Deps deps.ConfigDeps `yaml:"dependency"` | ||
| Header header.ConfigHeader `yaml:"header"` | ||
| Deps deps.ConfigDeps `yaml:"dependency"` | ||
| Languages map[string]comments.Language `yaml:"language"` |
There was a problem hiding this comment.
This config should be under Header
.licenserc.yaml
Outdated
| type: programming | ||
| color: "#00ADD8" | ||
| aliases: | ||
| - golang | ||
| extensions: | ||
| - ".go" | ||
| tm_scope: source.go | ||
| ace_mode: golang | ||
| codemirror_mode: go | ||
| codemirror_mime_type: text/x-go | ||
| language_id: 132 | ||
| comment_style_id: SlashAsterisk |
There was a problem hiding this comment.
Please minimize the configs, we only need some of the fields, like comment_style_id and extensions,
There was a problem hiding this comment.
Please minimize the configs, we only need some of the fields, like
comment_style_idandextensions,
Hi @kezhenxu94 , Thanks for reply, I will fix it.
|
Hi @kezhenxu94 , I considered about this way, but read code, |
Hi @dongzl , the way I proposed needs some other changes for sure, you can
|
Hi @kezhenxu94 , OK I understand, I will try it. |
| config.Paths = []string{"**"} | ||
| } | ||
|
|
||
| comments.OverrideLanguageCommentStyle(config.Languages) |
|
@dongzl nice done! Can you open another pull request to add the usage into the documentation as well? |
Hi @kezhenxu94 , Thanks for your code review, I will finish documentation. |
Recently, I use this project to fix myself project license header, It is a GoLand project.
I find that the header comment style config at the
languages.yamlandstyles.yaml, and it doesn't support config.The
Gofile license header comment style is//, like:But I want the license header comment style is
*, like:So, I fix code and submit this PR.
I add the config
languagesat the.licenserc.yaml, and the license header comment style use this file config preferentially, if this file doesn't have this config, it use the default config at thelanguages.yaml.