Skip to main content

#Precommit토론 중인 항목 0개

Hi, does anyone use pre-commit hooks to reorder XML files to minimize diffs down the pipeline ?  Do you have best practices crafted from this experience ?

 

#precommit #XML Reorder 

댓글 7개
  1. 2020년 9월 29일 오후 5:21
    @Rupert Barrow

    Our process is older (still using MDAPI) and a bit weird, but we end up doing a lot of things on a build server -- have jobs that retrieve the metadata from an org, then immediately format it before committing.

    I imagine a git pre-commit hook could work.

    You can also customize the SFDX CLI with command hooks, so perhaps you could implement a "postretrieve" command hook to sort and format the XML files as well. Good post here:

    https://developer.salesforce.com/blogs/2020/09/the-cli-and-salesforce-extensions.html
0/9000