google / google/vim-codefmt

Mechanism for passing arbitrary extra config to formatters

Ouverte
#66 3 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
Vim Script
Étoiles
1.1k
Forks
102
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Lots of formatters have extra config users may want to pass, and creating a top-level flag for each one will get cumbersome. We should consider a generic mechanism for passing flags through to formatters.

Factors to consider:
- These should be attached to the fine-grained formatter name, not the language, because we don't want to accidentally pass them to a different formatter that doesn't support them when the user switches formatter.
- Some might conflict with default flags. For instance, a user might want to pass `--type` to js-beautify and find that it conflicts with the `--type` flag we already pass by default.
- Most config would be per-path rather than global preferences. For instance, a user will want to configure an `--aosp` flag when working on Android Java, but then be surprised if it's applied to other Java code they're working on later.
- If possible, these config options should live in some project-local config file like `.clang-format` or `.editorconfig`, not something codefmt-specific, and codefmt should just try to be smart about detecting and not conflicting with such config where appropriate.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

L’issue cite .clang-format et .editorconfig comme sources possibles de configuration propres au projet, et mentionne --type et --aosp de js-beautify comme exemples. Commencez par déterminer comment les options spécifiques au formatter sont actuellement sélectionnées ; c’est terminé lorsqu’un mécanisme défini par formatter et par chemin évite les defaults contradictoires et la propagation involontaire.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
vim
Domaine
tooling
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.