Format using iwyu.

This commit is contained in:
ArthurSonzogni 2021-05-14 22:00:49 +02:00
parent 048efb6912
commit fcc49fdce7
No known key found for this signature in database
GPG Key ID: 41D98248C074CD6C
25 changed files with 106 additions and 98 deletions

View File

@ -1,11 +1,12 @@
#include <stddef.h> #include <stddef.h> // for size_t
#include <ftxui/dom/elements.hpp> #include <ftxui/dom/elements.hpp> // for operator|, size, Element, text, hcenter, Decorator, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN
#include <ftxui/screen/screen.hpp> #include <ftxui/screen/screen.hpp> // for Dimension, Screen
#include <ftxui/screen/string.hpp> #include <ftxui/screen/string.hpp> // for to_wstring
#include <string> #include <memory> // for shared_ptr
#include <string> // for allocator, operator+, char_traits, wstring
#include "ftxui/dom/node.hpp" #include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" #include "ftxui/screen/box.hpp" // for ftxui
int main(int argc, const char* argv[]) { int main(int argc, const char* argv[]) {
using namespace ftxui; using namespace ftxui;

View File

@ -1,13 +1,14 @@
#include <chrono> #include <chrono> // for operator""s, chrono_literals
#include <ftxui/dom/elements.hpp> #include <ftxui/dom/elements.hpp> // for paragraph, text, operator|, Element, border, color, hflow, spinner, vbox, bold, dim, underlined
#include <ftxui/screen/screen.hpp> #include <ftxui/screen/screen.hpp> // for Screen, Dimension
#include <iostream> #include <iostream> // for cout, ostream
#include <string> #include <memory> // for shared_ptr
#include <thread> #include <string> // for allocator, operator<<, string
#include <thread> // for sleep_for
#include "ftxui/dom/node.hpp" #include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/box.hpp" #include "ftxui/screen/box.hpp" // for ftxui
#include "ftxui/screen/color.hpp" #include "ftxui/screen/color.hpp" // for Color, Color::Red
int main(int argc, const char* argv[]) { int main(int argc, const char* argv[]) {
using namespace ftxui; using namespace ftxui;

View File

@ -30,7 +30,6 @@ Component Radiobox(const std::vector<std::wstring>* entries, int* selected_);
Component Toggle(const std::vector<std::wstring>* entries, int* selected); Component Toggle(const std::vector<std::wstring>* entries, int* selected);
Component Renderer(Component child, std::function<Element()>); Component Renderer(Component child, std::function<Element()>);
Component Renderer(std::function<Element()>); Component Renderer(std::function<Element()>);
template <class T> // T = {int, float} template <class T> // T = {int, float}
Component Slider(StringRef label, T* value, T min, T max, T increment); Component Slider(StringRef label, T* value, T min, T max, T increment);
@ -40,7 +39,7 @@ Component Horizontal(Components children);
Component Tab(int* selector, Components children); Component Tab(int* selector, Components children);
} // namespace Container } // namespace Container
}; // namespace ftxui } // namespace ftxui
#endif /* end of include guard: FTXUI_COMPONENT_HPP */ #endif /* end of include guard: FTXUI_COMPONENT_HPP */

View File

@ -1,13 +1,15 @@
#ifndef FTXUI_COMPONENT_RECEIVER_HPP_ #ifndef FTXUI_COMPONENT_RECEIVER_HPP_
#define FTXUI_COMPONENT_RECEIVER_HPP_ #define FTXUI_COMPONENT_RECEIVER_HPP_
#include <atomic> // for atomic #include <algorithm> // for copy, max
#include <atomic> // for atomic, __atomic_base
#include <condition_variable> // for condition_variable #include <condition_variable> // for condition_variable
#include <functional> #include <functional>
#include <iostream> #include <iostream>
#include <memory> // for unique_ptr, make_unique #include <memory> // for unique_ptr, make_unique
#include <mutex> // for mutex, unique_lock #include <mutex> // for mutex, unique_lock
#include <queue> // for queue #include <queue> // for queue
#include <utility> // for move
namespace ftxui { namespace ftxui {

View File

@ -1,11 +1,11 @@
#ifndef FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP #ifndef FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP
#define FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP #define FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP
#include <atomic> // for atomic #include <atomic> // for atomic
#include <ftxui/component/receiver.hpp> #include <ftxui/component/receiver.hpp> // for Receiver, Sender
#include <functional> // for function #include <functional> // for function
#include <memory> // for unique_ptr, shared_ptr #include <memory> // for shared_ptr
#include <string> // for string #include <string> // for string
#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse #include "ftxui/component/captured_mouse.hpp" // for CapturedMouse
#include "ftxui/component/event.hpp" #include "ftxui/component/event.hpp"

View File

@ -1,11 +1,11 @@
[ [
{ symbol: [ "VMIN", private, "<termios.h>", public ] },
{ symbol: [ "VTIME", private, "<termios.h>", public ] },
{ symbol: [ "ECHO", private, "<termios.h>", public ] }, { symbol: [ "ECHO", private, "<termios.h>", public ] },
{ symbol: [ "ICANON", private, "<termios.h>", public ] }, { symbol: [ "ICANON", private, "<termios.h>", public ] },
{ symbol: [ "termios", private, "<termios.h>", public ] },
{ symbol: [ "TCSANOW", private, "<termios.h>", public ] }, { symbol: [ "TCSANOW", private, "<termios.h>", public ] },
{ symbol: [ "__shared_ptr_access", private, "", public ] }, { symbol: [ "VMIN", private, "<termios.h>", public ] },
{ symbol: [ "ftxui", private , "", public ] }, { symbol: [ "VTIME", private, "<termios.h>", public ] },
{ include: ["ext/alloc_traits.h", "private", "<memory>", "public"] } { symbol: [ "__shared_ptr_access", private, "<memory>", public ] },
{ symbol: [ "termios", private, "<termios.h>", public ] },
{ symbol: ["__alloc_traits<>:value_type", private, "<vector>", public ] },
{ include: ["<ext/alloc_traits.h>", private, "<vector>", public] },
] ]

View File

@ -35,7 +35,7 @@ Component Checkbox(ConstStringRef label, bool* checked) {
} }
// static // static
CheckboxBase* From(Component component) { CheckboxBase* CheckboxBase::From(Component component) {
return static_cast<CheckboxBase*>(component.get()); return static_cast<CheckboxBase*>(component.get());
} }

View File

@ -1,7 +1,6 @@
#include <algorithm> // for find_if #include <algorithm> // for find_if, max
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type #include <iterator> // for begin, end
#include <iterator> // for begin, end #include <utility> // for move
#include <utility> // for move
#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse, CapturedMouseInterface #include "ftxui/component/captured_mouse.hpp" // for CapturedMouse, CapturedMouseInterface
#include "ftxui/component/component.hpp" #include "ftxui/component/component.hpp"

View File

@ -1,9 +1,8 @@
#include <stddef.h> // for size_t #include <stddef.h> // for size_t
#include <algorithm> // for max, min #include <algorithm> // for max, min
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type #include <memory> // for __shared_ptr_access, shared_ptr, make_shared, allocator, __shared_ptr_access<>::element_type, allocator_traits<>::value_type
#include <memory> // for __shared_ptr_access, shared_ptr, make_shared, __shared_ptr_access<>::element_type, allocator_traits<>::value_type
#include <utility> // for move #include <utility> // for move
#include <vector> // for vector, allocator #include <vector> // for vector, __alloc_traits<>::value_type
#include "ftxui/component/container.hpp" #include "ftxui/component/container.hpp"

View File

@ -10,7 +10,9 @@ using namespace ftxui;
TEST(ContainerTest, HorizontalEvent) { TEST(ContainerTest, HorizontalEvent) {
auto container = ContainerBase::Horizontal(); auto container = ContainerBase::Horizontal();
Component c0, c1, c2; auto c0 = Container::Horizontal({});
auto c1 = Container::Horizontal({});
auto c2 = Container::Horizontal({});
container->Add(c0); container->Add(c0);
container->Add(c1); container->Add(c1);
container->Add(c2); container->Add(c2);
@ -81,7 +83,9 @@ TEST(ContainerTest, HorizontalEvent) {
TEST(ContainerTest, VerticalEvent) { TEST(ContainerTest, VerticalEvent) {
auto container = ContainerBase::Vertical(); auto container = ContainerBase::Vertical();
Component c0, c1, c2; auto c0 = Container::Horizontal({});
auto c1 = Container::Horizontal({});
auto c2 = Container::Horizontal({});
container->Add(c0); container->Add(c0);
container->Add(c1); container->Add(c1);
container->Add(c2); container->Add(c2);
@ -152,7 +156,9 @@ TEST(ContainerTest, VerticalEvent) {
TEST(ContainerTest, SetActiveChild) { TEST(ContainerTest, SetActiveChild) {
auto container = ContainerBase::Horizontal(); auto container = ContainerBase::Horizontal();
Component c0, c1, c2; auto c0 = Container::Horizontal({});
auto c1 = Container::Horizontal({});
auto c2 = Container::Horizontal({});
container->Add(c0); container->Add(c0);
container->Add(c1); container->Add(c1);
container->Add(c2); container->Add(c2);

View File

@ -1,8 +1,7 @@
#include <stddef.h> // for size_t #include <stddef.h> // for size_t
#include <algorithm> // for max, min #include <algorithm> // for max, min
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type #include <memory> // for shared_ptr, allocator_traits<>::value_type
#include <memory> // for shared_ptr, allocator_traits<>::value_type #include <utility> // for move
#include <utility> // for move
#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse #include "ftxui/component/captured_mouse.hpp" // for CapturedMouse
#include "ftxui/component/event.hpp" // for Event, Event::ArrowDown, Event::ArrowUp, Event::Return, Event::Tab, Event::TabReverse #include "ftxui/component/event.hpp" // for Event, Event::ArrowDown, Event::ArrowUp, Event::Return, Event::Tab, Event::TabReverse

View File

@ -31,8 +31,8 @@
#endif #endif
#else #else
#include <sys/select.h> // for select, FD_ISSET, FD_SET, FD_ZERO, fd_set #include <sys/select.h> // for select, FD_ISSET, FD_SET, FD_ZERO, fd_set
#include <termios.h> // for tcsetattr, termios, tcgetattr, TCSANOW, cc_t, ECHO, ICANON, VMIN, VTIME #include <termios.h> // for tcsetattr, tcgetattr, cc_t
#include <unistd.h> // for STDIN_FILENO, read #include <unistd.h> // for STDIN_FILENO, read
#endif #endif
// Quick exit is missing in standard CLang headers // Quick exit is missing in standard CLang headers

View File

@ -1,7 +1,10 @@
#include "ftxui/component/terminal_input_parser.hpp" #include "ftxui/component/terminal_input_parser.hpp"
#include <utility> #include <algorithm> // for max
#include "ftxui/component/event.hpp" #include <memory> // for unique_ptr
#include <utility> // for move
#include "ftxui/component/event.hpp" // for Event
namespace ftxui { namespace ftxui {

View File

@ -5,11 +5,12 @@
#include <string> // for string #include <string> // for string
#include <vector> // for vector #include <vector> // for vector
#include "ftxui/component/event.hpp" // IWYU pragma: keep #include "ftxui/component/event.hpp" // for Event (ptr only)
#include "ftxui/component/mouse.hpp" // for Mouse #include "ftxui/component/mouse.hpp" // for Mouse
#include "ftxui/component/receiver.hpp" // for SenderImpl #include "ftxui/component/receiver.hpp" // for Sender
namespace ftxui { namespace ftxui {
struct Event;
// Parse a sequence of |char| accross |time|. Produces |Event|. // Parse a sequence of |char| accross |time|. Produces |Event|.
class TerminalInputParser { class TerminalInputParser {

View File

@ -1,9 +1,12 @@
#include <gtest/gtest-message.h> // for Message #include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for TestPartResult #include <gtest/gtest-test-part.h> // for TestPartResult, SuiteApiResolver, TestFactoryImpl
#include <algorithm> // for max
#include <memory> // for unique_ptr, allocator
#include "ftxui/component/event.hpp" // for Event, Event::Escape
#include "ftxui/component/receiver.hpp" // for MakeReceiver, ReceiverImpl #include "ftxui/component/receiver.hpp" // for MakeReceiver, ReceiverImpl
#include "ftxui/component/terminal_input_parser.hpp" #include "ftxui/component/terminal_input_parser.hpp"
#include "gtest/gtest_pred_impl.h" // for AssertionResult, Test, Suite... #include "gtest/gtest_pred_impl.h" // for AssertionResult, Test, EXPECT_EQ, EXPECT_TRUE, EXPECT_FALSE, TEST
using namespace ftxui; using namespace ftxui;

View File

@ -1,9 +1,8 @@
#include <algorithm> // for max #include <algorithm> // for max
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type #include <iterator> // for begin, end
#include <iterator> // for begin, end #include <memory> // for make_shared, __shared_ptr_access
#include <memory> // for make_shared, __shared_ptr_access #include <utility> // for move
#include <utility> // for move #include <vector> // for vector, __alloc_traits<>::value_type
#include <vector> // for vector
#include "ftxui/dom/elements.hpp" // for unpack, Element, Decorator, Elements, border, borderWith, window #include "ftxui/dom/elements.hpp" // for unpack, Element, Decorator, Elements, border, borderWith, window
#include "ftxui/dom/node.hpp" // for Node #include "ftxui/dom/node.hpp" // for Node

View File

@ -1,7 +1,6 @@
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type #include <memory> // for make_shared, __shared_ptr_access
#include <memory> // for make_shared, __shared_ptr_access #include <utility> // for move
#include <utility> // for move #include <vector> // for vector, __alloc_traits<>::value_type
#include <vector> // for vector
#include "ftxui/dom/elements.hpp" // for Element, unpack, filler, flex, flex_grow, flex_shrink, notflex, xflex, xflex_grow, xflex_shrink, yflex, yflex_grow, yflex_shrink #include "ftxui/dom/elements.hpp" // for Element, unpack, filler, flex, flex_grow, flex_shrink, notflex, xflex, xflex_grow, xflex_shrink, yflex, yflex_grow, yflex_shrink
#include "ftxui/dom/node.hpp" // for Node #include "ftxui/dom/node.hpp" // for Node

View File

@ -1,8 +1,7 @@
#include <algorithm> // for max, min #include <algorithm> // for max, min
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type #include <memory> // for make_shared, shared_ptr, __shared_ptr_access
#include <memory> // for make_shared, shared_ptr, __shared_ptr_access #include <utility> // for move
#include <utility> // for move #include <vector> // for vector, __alloc_traits<>::value_type
#include <vector> // for vector
#include "ftxui/dom/elements.hpp" // for Element, unpack, focus, frame, select, xframe, yframe #include "ftxui/dom/elements.hpp" // for Element, unpack, focus, frame, select, xframe, yframe
#include "ftxui/dom/node.hpp" // for Node #include "ftxui/dom/node.hpp" // for Node

View File

@ -1,6 +1,5 @@
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type #include <memory> // for __shared_ptr_access
#include <memory> // for __shared_ptr_access #include <vector> // for __alloc_traits<>::value_type, vector
#include <vector> // for vector
#include "ftxui/dom/node_decorator.hpp" #include "ftxui/dom/node_decorator.hpp"
#include "ftxui/dom/requirement.hpp" // for Requirement #include "ftxui/dom/requirement.hpp" // for Requirement

View File

@ -1,7 +1,6 @@
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type #include <memory> // for make_shared, __shared_ptr_access
#include <memory> // for make_shared, __shared_ptr_access #include <utility> // for move
#include <utility> // for move #include <vector> // for __alloc_traits<>::value_type, vector
#include <vector> // for vector
#include "ftxui/dom/elements.hpp" // for Element, unpack, Decorator, reflect #include "ftxui/dom/elements.hpp" // for Element, unpack, Decorator, reflect
#include "ftxui/dom/node.hpp" // for Node #include "ftxui/dom/node.hpp" // for Node

View File

@ -1,9 +1,8 @@
#include <stddef.h> // for size_t #include <stddef.h> // for size_t
#include <algorithm> // for min, max #include <algorithm> // for min, max
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type #include <memory> // for make_shared, __shared_ptr_access
#include <memory> // for make_shared, __shared_ptr_access #include <utility> // for move
#include <utility> // for move #include <vector> // for __alloc_traits<>::value_type, vector
#include <vector> // for vector
#include "ftxui/dom/elements.hpp" // for Constraint, Direction, EQUAL, GREATER_THAN, LESS_THAN, WIDTH, unpack, Decorator, Element, size #include "ftxui/dom/elements.hpp" // for Constraint, Direction, EQUAL, GREATER_THAN, LESS_THAN, WIDTH, unpack, Decorator, Element, size
#include "ftxui/dom/node.hpp" // for Node #include "ftxui/dom/node.hpp" // for Node

View File

@ -1,9 +1,8 @@
#include <stddef.h> // for size_t #include <stddef.h> // for size_t
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type #include <memory> // for allocator, allocator_traits<>::value_type
#include <memory> // for allocator, allocator_traits<>::value_type #include <string> // for basic_string, wstring
#include <string> // for basic_string, wstring #include <utility> // for move
#include <utility> // for move #include <vector> // for vector, __alloc_traits<>::value_type
#include <vector> // for vector
#include "ftxui/dom/elements.hpp" // for Element, gauge, text, vbox, spinner #include "ftxui/dom/elements.hpp" // for Element, gauge, text, vbox, spinner

View File

@ -1,5 +1,6 @@
#include <functional> // for function #include <functional> // for function
#include <utility> // for move #include <utility> // for move
#include <vector> // for vector
#include "ftxui/dom/elements.hpp" // for Decorator, Element, Elements, operator|, nothing #include "ftxui/dom/elements.hpp" // for Decorator, Element, Elements, operator|, nothing

View File

@ -1,5 +1,4 @@
#include <algorithm> // for min #include <algorithm> // for min
#include <ext/alloc_traits.h> // for __alloc_traits<>::value_type
#include <iostream> // for operator<<, basic_ostream, wstringstream, stringstream, flush, cout, ostream #include <iostream> // for operator<<, basic_ostream, wstringstream, stringstream, flush, cout, ostream
#include <sstream> // IWYU pragma: keep #include <sstream> // IWYU pragma: keep

View File

@ -6,6 +6,8 @@ mkdir -p iwyu
cd iwyu cd iwyu
rm * -rf rm * -rf
echo $CMAKE_CXX_INCLUDE_WHAT_YOU_USE echo $CMAKE_CXX_INCLUDE_WHAT_YOU_USE
cmake .. -DFTXUI_BUILD_TESTS=ON -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="iwyu;-Xiwyu;--cxx17ns;-Xiwyu;--mapping_file=${mapping_dir}/iwyu.imp;-Xiwyu;--verbose=3" cmake .. -DFTXUI_BUILD_TESTS=ON -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-Xiwyu;--cxx17ns;-Xiwyu;--mapping_file=${mapping_dir}/iwyu.imp;-Xiwyu;--verbose=3"
make -j 2>out make -j 2>out
fix_include --comments < out fix_includes.py --comments < out
../tools/format.sh