File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -55,22 +55,23 @@ jobs:
55
55
script : |
56
56
set -euo pipefail
57
57
58
- echo '::group::Setup environment'
59
- CONDA_PATH=$(which conda)
60
- eval "$(${CONDA_PATH} shell.bash hook)"
61
- conda create --name ci --quiet --yes -c conda-forge python=3.11 ncurses=5 libgcc
62
- conda activate ci
63
- export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}"
64
- echo '::endgroup::'
65
-
66
58
echo '::group::Install lint tools'
67
- curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format
68
- chmod +x ./clang-format
59
+ # Install clang-format via package manager (more reliable than binary download)
60
+ if command -v apt-get &> /dev/null; then
61
+ apt-get update && apt-get install -y clang-format
62
+ elif command -v yum &> /dev/null; then
63
+ yum install -y clang-tools-extra
64
+ elif command -v dnf &> /dev/null; then
65
+ dnf install -y clang-tools-extra
66
+ else
67
+ echo "No supported package manager found"
68
+ exit 1
69
+ fi
69
70
echo '::endgroup::'
70
71
71
72
echo '::group::Lint C source'
72
73
set +e
73
- ./.github/unittest/linux/scripts/run-clang-format.py -r torchrl/csrc --clang-format-executable ./ clang-format
74
+ python3 ./.github/unittest/linux/scripts/run-clang-format.py -r torchrl/csrc --clang-format-executable clang-format
74
75
75
76
if [ $? -ne 0 ]; then
76
77
git --no-pager diff
Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ class SegmentTree {
43
43
public:
44
44
SegmentTree (int64_t size, const T& identity_element)
45
45
: size_(size), identity_element_(identity_element) {
46
- for (capacity_ = 1 ; capacity_ <= size; capacity_ <<= 1 )
47
- ;
46
+ for (capacity_ = 1 ; capacity_ <= size; capacity_ <<= 1 );
48
47
values_.assign (2 * capacity_, identity_element_);
49
48
}
50
49
You can’t perform that action at this time.
0 commit comments