danger / swift

⚠️ Stop saying "you forgot to …" in code review
https://danger.systems/swift/
MIT License
1.04k stars 135 forks source link

Ability to change Meta information #559

Closed Nikoloutsos closed 3 weeks ago

Nikoloutsos commented 1 year ago

Hi 👋 , there is a need from my side to change the meta information showing in the text info.

Currently we have this:

public struct Meta: Encodable {
    let runtimeName = "Danger Swift"
    let runtimeHref = "https://danger.systems/swift"
}

There is no way you can change this value, so I was guessing if you are okay with me making a PR about it and giving this ability.

I am thinking that users can use a custom flag --metaRuntimeName and --metaruntimeHref to alter it. Or just add a new method in DangerDSL that will be.

/// Change the metadata showing in the bottom of the PR
func meta(meta: Meta) {
    globalResults.meta = meta
}

But I'd like to hear your opinion before starting working on this

Nikoloutsos commented 1 year ago

A follow-up comment. I guess another option is to fork this repo and change it.

orta commented 1 year ago

I'm more interested in what you'd want to change it to? I've had a request to remove it in Danger JS but to change it to something else is pretty new

Nikoloutsos commented 1 year ago

A short into: @orta I've been building an open-source library and using it in my company atm named Walle which is powered by danger. Walle can be setup by just creating a .walle.yml in your repo. This config describes what ready-to-use steps to run in your repo. Example

- name: "WorkInProgressStep"
- name: "CommitsLintStep"
  inputs:
    regex: "^(Merge|Add|Drop|Fix|Bump|Make|Start|Stop|Optimize|Document|Refactor|Reformat|Rearrange|Redraw|Reword|Scaffold) .+$"
    max_characters: 50
- name: "XCResultSummaryStep"
- name: "SwiftlintStep"
- name: "JSONYAMLValidationStep"

JSONYAMLValidationStep verifies all JSON/YML added/edited are valid. CommitsLintStep verifies commits are following a pattern. XCResultSummaryStep Reports .xcresult (warnings, error, failled tests etc).

The idea is to keep the configuration stupid simple and provide ready to use steps.

Why I want this feature? When Walle is reporting, I want the meta information to be like

Generated by ❤️ 🤖 Walle against ed31s

And here is a sneak peak of what Walle reporting looks like: image

f-meloni commented 1 year ago

Cool! Yes sure makes sense to me :)