mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[ci] Upgrade wpiformat (#8124)
See https://github.com/wpilibsuite/styleguide/pull/312
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
color: false
|
|
||||||
definitions: [cmake/modules]
|
definitions: [cmake/modules]
|
||||||
line_length: 100
|
line_length: 100
|
||||||
list_expansion: favour-inlining
|
list_expansion: favour-inlining
|
||||||
quiet: false
|
|
||||||
unsafe: false
|
unsafe: false
|
||||||
|
|||||||
4
.github/workflows/lint-format.yml
vendored
4
.github/workflows/lint-format.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
- name: Install wpiformat
|
- name: Install wpiformat
|
||||||
run: |
|
run: |
|
||||||
python -m venv ${{ runner.temp }}/wpiformat
|
python -m venv ${{ runner.temp }}/wpiformat
|
||||||
${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2025.33
|
${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2025.34
|
||||||
- name: Run
|
- name: Run
|
||||||
run: ${{ runner.temp }}/wpiformat/bin/wpiformat
|
run: ${{ runner.temp }}/wpiformat/bin/wpiformat
|
||||||
- name: Check output
|
- name: Check output
|
||||||
@@ -78,7 +78,7 @@ jobs:
|
|||||||
- name: Install wpiformat
|
- name: Install wpiformat
|
||||||
run: |
|
run: |
|
||||||
python -m venv ${{ runner.temp }}/wpiformat
|
python -m venv ${{ runner.temp }}/wpiformat
|
||||||
${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2025.33
|
${{ runner.temp }}/wpiformat/bin/pip3 install wpiformat==2025.34
|
||||||
- name: Create compile_commands.json
|
- name: Create compile_commands.json
|
||||||
run: |
|
run: |
|
||||||
./gradlew generateCompileCommands -Ptoolchain-optional-roboRio
|
./gradlew generateCompileCommands -Ptoolchain-optional-roboRio
|
||||||
|
|||||||
@@ -773,8 +773,7 @@ void MjpegServerImpl::ConnThread::SendStream(wpi::raw_socket_ostream& os) {
|
|||||||
lastFrameTime = thisFrameTime;
|
lastFrameTime = thisFrameTime;
|
||||||
double timestamp = lastFrameTime / 1000000.0;
|
double timestamp = lastFrameTime / 1000000.0;
|
||||||
header.clear();
|
header.clear();
|
||||||
oss << "\r\n--" BOUNDARY "\r\n"
|
oss << "\r\n--" BOUNDARY "\r\n" << "Content-Type: image/jpeg\r\n";
|
||||||
<< "Content-Type: image/jpeg\r\n";
|
|
||||||
wpi::print(oss, "Content-Length: {}\r\n", size);
|
wpi::print(oss, "Content-Length: {}\r\n", size);
|
||||||
wpi::print(oss, "X-Timestamp: {}\r\n", timestamp);
|
wpi::print(oss, "X-Timestamp: {}\r\n", timestamp);
|
||||||
oss << "\r\n";
|
oss << "\r\n";
|
||||||
|
|||||||
@@ -398,8 +398,9 @@ void HAL_SetCTREPCMOneShotDuration(HAL_CTREPCMHandle handle, int32_t index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::scoped_lock lock{pcm->lock};
|
std::scoped_lock lock{pcm->lock};
|
||||||
pcm->oneShot.sol10MsPerUnit[index] = (std::min)(
|
pcm->oneShot.sol10MsPerUnit[index] =
|
||||||
static_cast<uint32_t>(durMs) / 10, static_cast<uint32_t>(0xFF));
|
(std::min)(static_cast<uint32_t>(durMs) / 10,
|
||||||
|
static_cast<uint32_t>(0xFF));
|
||||||
HAL_WriteCANPacketRepeating(pcm->canHandle, pcm->oneShot.sol10MsPerUnit, 8,
|
HAL_WriteCANPacketRepeating(pcm->canHandle, pcm->oneShot.sol10MsPerUnit, 8,
|
||||||
Control3, SendPeriod, status);
|
Control3, SendPeriod, status);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class SimCallbackRegistry : public impl::SimCallbackRegistryBase {
|
|||||||
*/
|
*/
|
||||||
#define HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(NAME) \
|
#define HAL_SIMCALLBACKREGISTRY_DEFINE_NAME(NAME) \
|
||||||
static LLVM_ATTRIBUTE_ALWAYS_INLINE constexpr const char* \
|
static LLVM_ATTRIBUTE_ALWAYS_INLINE constexpr const char* \
|
||||||
Get##NAME##Name() { \
|
Get##NAME##Name() { \
|
||||||
return #NAME; \
|
return #NAME; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class SimDataValue final : public impl::SimDataValueBase<T, MakeValue> {
|
|||||||
*/
|
*/
|
||||||
#define HAL_SIMDATAVALUE_DEFINE_NAME(NAME) \
|
#define HAL_SIMDATAVALUE_DEFINE_NAME(NAME) \
|
||||||
static LLVM_ATTRIBUTE_ALWAYS_INLINE constexpr const char* \
|
static LLVM_ATTRIBUTE_ALWAYS_INLINE constexpr const char* \
|
||||||
Get##NAME##Name() { \
|
Get##NAME##Name() { \
|
||||||
return #NAME; \
|
return #NAME; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -334,9 +334,9 @@ std::optional<std::vector<uint8_t>> WireDecoder3::ReadRaw(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// string data
|
// string data
|
||||||
size_t toCopy = (std::min)(
|
size_t toCopy = (std::min)(static_cast<size_t>(in->size()),
|
||||||
static_cast<size_t>(in->size()),
|
static_cast<size_t>(m_rawReader.len.value() -
|
||||||
static_cast<size_t>(m_rawReader.len.value() - m_rawReader.buf.size()));
|
m_rawReader.buf.size()));
|
||||||
m_rawReader.buf.insert(m_rawReader.buf.end(), in->begin(),
|
m_rawReader.buf.insert(m_rawReader.buf.end(), in->begin(),
|
||||||
in->begin() + toCopy);
|
in->begin() + toCopy);
|
||||||
*in = wpi::drop_front(*in, toCopy);
|
*in = wpi::drop_front(*in, toCopy);
|
||||||
|
|||||||
@@ -482,11 +482,10 @@ constexpr dimensionless::scalar_t log2(const ScalarUnit x) noexcept {
|
|||||||
template <
|
template <
|
||||||
class UnitType,
|
class UnitType,
|
||||||
std::enable_if_t<units::traits::has_linear_scale<UnitType>::value, int> = 0>
|
std::enable_if_t<units::traits::has_linear_scale<UnitType>::value, int> = 0>
|
||||||
inline constexpr auto sqrt(const UnitType& value) noexcept
|
inline constexpr auto sqrt(const UnitType& value) noexcept -> unit_t<
|
||||||
-> unit_t<
|
square_root<typename units::traits::unit_t_traits<UnitType>::unit_type>,
|
||||||
square_root<typename units::traits::unit_t_traits<UnitType>::unit_type>,
|
typename units::traits::unit_t_traits<UnitType>::underlying_type,
|
||||||
typename units::traits::unit_t_traits<UnitType>::underlying_type,
|
linear_scale> {
|
||||||
linear_scale> {
|
|
||||||
return unit_t<
|
return unit_t<
|
||||||
square_root<typename units::traits::unit_t_traits<UnitType>::unit_type>,
|
square_root<typename units::traits::unit_t_traits<UnitType>::unit_type>,
|
||||||
typename units::traits::unit_t_traits<UnitType>::underlying_type,
|
typename units::traits::unit_t_traits<UnitType>::underlying_type,
|
||||||
@@ -742,8 +741,8 @@ template <class UnitTypeLhs, class UnitMultiply, class UnitAdd,
|
|||||||
class = std::enable_if_t<traits::is_unit_t<UnitTypeLhs>::value &&
|
class = std::enable_if_t<traits::is_unit_t<UnitTypeLhs>::value &&
|
||||||
traits::is_unit_t<UnitMultiply>::value &&
|
traits::is_unit_t<UnitMultiply>::value &&
|
||||||
traits::is_unit_t<UnitAdd>::value>>
|
traits::is_unit_t<UnitAdd>::value>>
|
||||||
auto fma(const UnitTypeLhs x, const UnitMultiply y,
|
auto fma(const UnitTypeLhs x, const UnitMultiply y, const UnitAdd z) noexcept
|
||||||
const UnitAdd z) noexcept -> decltype(x * y) {
|
-> decltype(x * y) {
|
||||||
using resultType = decltype(x * y);
|
using resultType = decltype(x * y);
|
||||||
static_assert(
|
static_assert(
|
||||||
traits::is_convertible_unit_t<
|
traits::is_convertible_unit_t<
|
||||||
|
|||||||
Reference in New Issue
Block a user