sourcery-ai / sourcery

Instant AI code reviews
https://sourcery.ai
MIT License
1.53k stars 66 forks source link

refactorings/switch bug #236

Closed imba-tjd closed 2 years ago

imba-tjd commented 2 years ago

Issue description or question

See https://github.com/imba-tjd/viztracer/pull/1#discussion_r863781996 or https://github.com/imba-tjd/viztracer/pull/1/files/ba2327e2457254fdbbf41062be42b06e481ac96c#diff-d185ee100bb846a83bef32ff1f863d59342312116fc4a44c43a6298aa87f370eL158

It changed

if self.inst_type == "log_var":
    event = "instant"
elif self.inst_type == "log_number":
    event = "counter"

to

if self.inst_type == "log_number":
    event = "counter"
elif self.inst_type == "log_var":
    event = "instant"

which is meaningless.

Hellebore commented 2 years ago

Agreed that this isn't desired behaviour - we're tracking this here: https://github.com/sourcery-ai/sourcery/issues/102

Closing this as duplicate.