Skip to content

Commit

Permalink
Remove specific line in BitcoinTx.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
michalinacienciala committed Mar 2, 2023
1 parent b2ae64d commit 8f30755
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,25 @@ 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: |
find ./contracts \
-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
Expand Down

0 comments on commit 8f30755

Please sign in to comment.