From 8f30755ffa90bb132278bdefda57b31278de79ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Thu, 2 Mar 2023 14:59:58 +0100 Subject: [PATCH] Remove specific line in `BitcoinTx.sol` --- .github/workflows/docs.yml | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3c8500acd..5af97d787 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -42,23 +42,17 @@ jobs: # In this step we modify the format of the comments in the Solidity # contracts files. We do that because our original formatting is not - # processed by Docgen in the way we would like. In order to get the - # results we want, we need to remove lines with empty `//` or `///` - # comments and remove trailing spaces in the comments. - # 1. `sed 's_///[[:blank:]]*_///_'` which substitutes `///` + 0 or more - # spaces/tabs with just `///`, - # 2. `sed ':a;N;$!ba;s_[[:blank:]]*/{2,3}\n__g'` which substitutes 0 or - # more spaces/tabs + `//` or `///` + newline char with `` and does this - # in a loop. - - # - name: Prepare contract files for further processing - # run: | - # find ./contracts \ - # -name "*.sol" \ - # -type f \ - # -exec sed -i 's_///[[:blank:]]*_///_' {} \; \ - # -exec sed -i ':a;N;$!ba;s_[[:blank:]]*///\n__g' {} \; - # -exec sed -i ':a;N;$!ba;s_[[:blank:]]*//\n__g' {} \; + # processed by Docgen in the way we would like. + # To nicely display lists (like the list of requirements) we need to + # remove multiple space chars after the `///` comment. We do that by + # executing `sed 's_///[[:blank:]]*_///_'` on all contracts files, which + # substitutes `///` + 0 or more spaces/tabs with just `///`. + # We also need to remove unnecessary `//` comment used in the `@dev` + # section of `BitcoinTx` documentation, which was causing problem with + # rendering of the `.md` file. We do that by executing + # `sed -i ':a;N;$!ba;s_///\n//\n_///\n_g'` on the problematic file. The + # command substitutes `///` + newline + `//` + newline with just `///` + + # newline and does this in a loop. - name: Prepare contract files for further processing run: | @@ -66,8 +60,7 @@ jobs: -name "*.sol" \ -type f \ -exec sed -i 's_///[[:blank:]]*_///_' {} \; - - # sed -i ':a;N;$!ba;s_[[:blank:]]*//\n__g' ./contracts/bridge/BitcoinTx.sol + sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol # TODO: Rebove after testing - name: Export artifacts