Size: 2090
Comment:
|
← Revision 5 as of 2020-05-11 20:06:51 ⇥
Size: 2634
Comment: grammar
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
Line 6: | Line 5: |
Line 16: | Line 14: |
Line 23: | Line 20: |
`fix` deal with the first 2; Format source deal with the first and the last. We want an unified approache using common code, common config and common UX/UI. | `fix` deals with the first 2; Format source deals with the first and the last. We want a unified approache using common code, common config and common UX/UI. |
Line 26: | Line 23: |
=== config === ||idea ||fix ||format source ||proposal || ||command line ||fix.TOOL:command ({rootpath}) ||format-source.TOOL ($HG_FILENAME) || || ||line range flag ||fix.TOOL:linerange ({first}:{last}) ||ø || || || ||fix.TOOL:skipclean=BOOL ||ø || || ||pattern to format ||fix.TOOL:pattern ||in `.hg-format-source` || || ||tool priority ||fix.TOOL:priority ||ø || || ||metadata (strange) ||fix.TOOL:metadata=BOOL ||ø || || ||mode ||ø ||format-source.TOOL:mode={pipe/file} || || ||(input mode) ||ø ||format-source.TOOL:mode.input={pipe/file} || || ||(output mode) ||ø ||format-source.TOOL:mode.output={pipe/file} || || ||tool version ||ø ||format-source.TOOL:version-command || || ||version format ||ø ||format-source.TOOL:version-regex || || ||path of default config files ||ø ||format-source.TOOL:configpaths=[] || || |
|
Line 28: | Line 39: |
=== config === | (format-sources also have a global `run-mode` config) |
Line 30: | Line 41: |
|| idea || fix || format source || proposal || || command line || fix.TOOL:command ({rootpath}) || format-source.TOOL ($HG_FILENAME)|| || || line range flag || fix.TOOL:linerange ({first}:{last}) || ø || || || || fix.TOOL:skipclean=BOOL || ø || || || pattern to format || fix.TOOL:pattern || in `.hg-format-source` || || || tool priority || fix.TOOL:priority || ø || || || || metadata (strange) || fix.TOOL:metadata=BOOL || ø || || || mode || ø || format-source.TOOL:mode={pipe/file} || || || (input mode) || ø || format-source.TOOL:mode.input={pipe/file} || || || (output mode) || ø || format-source.TOOL:mode.output={pipe/file} || || || tool version || ø || format-source.TOOL:version-command || || || version format || ø || format-source.TOOL:version-regex || || || path of default config files || ø || format-source.TOOL:configpaths=[] || || |
In addition, format-source comes with default definition for common tools. |
Line 51: | Line 44: |
Regarding command: * `hg fix -w [--whole]` == `hg format-source --current` * `hg fix --rev REV [--whole]` rewrite changesets (involved flag `-rev`, `--base` `--all`) * `hg format-source TOOL PATTERN [--extra-config-file]` create a new changeset (involved `-m`, `-u`, `-d`, `-l` |
|
Line 53: | Line 51: |
* (./) various * (./) step * {X} That * {X} need * {X} to * {X} be * {X} performed |
* decide on config * decide on UI * decide on "in repo" format * write a common library * write final commands * put this in core ? * ... * profit |
Line 63: | Line 61: |
* pointer * to * related * page |
* AutomaticFormattingPlan * https://bitbucket.org/octobus/format-source/src/default/ * https://octobus.net/blog/2018-12-03-mercurial-format-source-0.2.0.html |
Note:
This page is primarily intended for developers of Mercurial.
Unifying Fix and FormatSource Extensions
Status: Project
Main proponents: DannyHooper and Pierre-YvesDavid
Source formatting is great and a trending topic. There are multiples associated issues. The fix extensions deal with a subset of these issue and the format-source extensions deal with another subset (with some overlap).
We should have a single extension dealing with all issues.
1. Goal
There is three main issue with source formatting:
- Applying formatting in your working copy
- Applying formatting on content of existing draft changesets
- Applying formatting change during merge // minimizing conflict that are purely formatting.
fix deals with the first 2; Format source deals with the first and the last. We want a unified approache using common code, common config and common UX/UI.
2. Detailed description
2.1. config
idea |
fix |
format source |
proposal |
command line |
fix.TOOL:command ({rootpath}) |
format-source.TOOL ($HG_FILENAME) |
|
line range flag |
fix.TOOL:linerange ({first}:{last}) |
ø |
|
|
fix.TOOL:skipclean=BOOL |
ø |
|
pattern to format |
fix.TOOL:pattern |
in .hg-format-source |
|
tool priority |
fix.TOOL:priority |
ø |
|
metadata (strange) |
fix.TOOL:metadata=BOOL |
ø |
|
mode |
ø |
format-source.TOOL:mode={pipe/file} |
|
(input mode) |
ø |
format-source.TOOL:mode.input={pipe/file} |
|
(output mode) |
ø |
format-source.TOOL:mode.output={pipe/file} |
|
tool version |
ø |
format-source.TOOL:version-command |
|
version format |
ø |
format-source.TOOL:version-regex |
|
path of default config files |
ø |
format-source.TOOL:configpaths=[] |
|
(format-sources also have a global run-mode config)
In addition, format-source comes with default definition for common tools.
2.2. user interface
Regarding command:
hg fix -w [--whole] == hg format-source --current
hg fix --rev REV [--whole] rewrite changesets (involved flag -rev, --base --all)
hg format-source TOOL PATTERN [--extra-config-file] create a new changeset (involved -m, -u, -d, -l
3. Roadmap
- decide on config
- decide on UI
- decide on "in repo" format
- write a common library
- write final commands
- put this in core ?
- ...
- profit