[Feature]: Add "verify" option to xcprojformatter

Aberta
#20 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
58/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
swift
Domínio
cli

Direção de pesquisa

Start by reading the xcprojformatter command-line entry point and the existing --update implementation to see how it reads and formats a project file. Then check how CLI options and command tests are organized. Done means a verify option or subcommand reports success for canonical input and fails for input that formatting would change; the issue leaves the failure output format open.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

enhancement
Describe the feature

Add a new option to xcprojformatter that "verifies" an .xcproj file. If the file is already in the canonical format (i.e. the file is unaffected by running xcprojformatter --update project.xcproj), the command succeeds; if the file is not in the canonical format (the file is modified by running xcprojformatter --update project.xcproj) the command fails.
This could either be a new flag, such as xcprojformatter --verify --input project.xcproj, or a new subcommand, xcprojformatter verify --input project.xcproj.
In its simplest form, a failing verification simply fails with no output. A more user-friendly version would give some sort of output to indicate what part of the file that is not in the canonical format.

Use case

Having a verify option is great in CI pipelines for Xcode projects. With it, one could enforce in PRs that the .xcproj file is not modified such that it's no longer in the canonical format. This is similar to how swift format lint can be used for source code, including Package.swift.

Alternatives considered

It is possible to do this manually, by running xcprojformatter --input <...> --output <...> and comparing the files. However, it would be natural if the cli provided this out-of-the-box.

Additional context

No response

Linguagem predominante
Swift
Estrelas
544
Forks
36
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de apple/xcode-project-format

Todas as issues de apple/xcode-project-format

Issues semelhantes

Mais issues de Swift

Receba novas issues na sua caixa de entrada

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