ES-DOC / esdoc-cim-v2-schema

Canonical CIM schema v2 definition
2 stars 5 forks source link

Line-wrapping, auto-formatting and pre-commit hooks #49

Closed sadielbartholomew closed 3 years ago

sadielbartholomew commented 3 years ago
  1. Resolve #46 (see commits e6c10d5 and fd0bc2e) and resolve #47 (see first two commits and a trivial change in 92649e1).
  2. In the process, add a black configuration file (d3df227) and configure pre-commit hooks, which all pass at the final commit of this PR, to enforce the same formatting at commit time (9ccaf6c).
  3. When formatting the line-wrapping I barely looked at the text and yet I noticed a property description which was trivially wrong and in a confusing way, so I fixed that: see e0cc2e9.
sadielbartholomew commented 3 years ago

@davidhassell, though most of this is trivial, you may wish to cast an eye over the manual part, the line-wrapping (commit fd0bc2e), in case I made any mistakes (just needs if anything eyeballing to check the wrapped lines end with a whitespace), and e0cc2e9 because even though it is a trivial and non-controversial change, that is one which changes the CIM (but in a very minor way).

sadielbartholomew commented 3 years ago

I am thinking I might add a basic GitHub Action to confirm the auto-formatting has been applied by running the pre-commit hooks in a workflow job. Will push a further commit to add that now.

sadielbartholomew commented 3 years ago

Seeing if I can trigger the Actions job initially via open-close, though it may be that this PR needs to be merged before it will recognise the Actions workflow and not tell us that CI "has not been set up" as shown above...

davidhassell commented 3 years ago

Just eye-balled https://github.com/ES-DOC/esdoc-cim-v2-schema/commit/fd0bc2ec3a54c9b626e3958d6024161c501c36a7 and https://github.com/ES-DOC/esdoc-cim-v2-schema/commit/e0cc2e94278d72e9172629b17ee36ea2fe223221 - both look good to me.

sadielbartholomew commented 3 years ago

Thanks @davidhassell, in that case I will merge this and tag version 2.2!