afnanenayet / afnanenayet/diffsitter

Options to only show functional changes in diffs

Aberta
#349 5 comentários 0 reações 0 responsáveis Ver no GitHub
diff-algo enhancement
Linguagem predominante
Rust
Estrelas
2.4k
Forks
53
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

**Is your feature request related to a problem? Please describe.**

I noticed that diffsitter returns `0` when the two files have the same AST, which is awesome. However, it still produces output if there are nonfunctional changes. Example programs:

```go
package main

import "fmt"

func main() {
a := "string"
fmt.Println(a)
}
```

```go
package main

import "fmt"

// comments in the file
func main() {
b := "string"
fmt.Println(b)
}
```

Produces:

```
diffsitter a/main.go b/main.go   main
a/main.go -> b/main.go
======================

4:
--
+ // comments in the file

6 - 7:
------
+ b := "string"
+ fmt.Println(b)

5 - 6:
------
- a := "string"
- fmt.Println(a)
```

In the event that you have something like a mass refactor which you expect not to have functional changes, if one ends up showing up you are not easily able to find it.

**Describe the solution you'd like**

I would like it if there were a setting which, when enabled, would make `diffsitter` print only the changes which meaningfully alter the AST.

**Describe alternatives you've considered**

I thought about writing my own but it would only support Go. This project seems like a great base to bring this to many languages.

**Additional context**

I am not sure but I would suspect the various different semantics between languages may make this a somewhat complicated request (I don't know off the top of my head but I suspect, software being the way it is, that there may exist a language or framework where merely changing a variable name has functional impacts).

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.