Skip to content

Commit

Permalink
test cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Jun 23, 2024
1 parent be7a7a0 commit 825565d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/other/apply-doc-cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ find . -type f -name '*.rs' \
| while read -r file; do
# Replace #[cfg(...)] with #[doc(cfg(...))]. Do not insert a newline, in case the #[cfg] is commented-out.
# shellcheck disable=SC2016
$sd '(\#\[(cfg\(.+?\))\])\s*([A-Za-z]|#\[)' '$1 #[cfg_attr(published_docs, doc($2))]\n$3' "$file"
$sd '(\#\[(cfg\(.+?\))\])(\s)*([A-Za-z]|#\[)' '$1 #[cfg_attr(published_docs, doc($2))]\n$3$4' "$file"
# $sd '(\#\[(cfg\(.+?\))\])\s*([A-Za-z]|#\[)' '$1 #[doc($2)]\n$3' "$file"
# ^^^^^^^^^^^^^^^^^ require that #[cfg] is followed by an identifier or a #[ attribute start.
# This avoids some usages of function-local #[cfg]s, although by far not all. Others generate warnings, which is fine.
Expand Down

0 comments on commit 825565d

Please sign in to comment.