Contributing

Daan De Meyer edited this page Jul 28, 2018 · 1 revision

Contributing

Compile with CMAKE_BUILD_TYPE=Debug

# Run doctest tests
build/debug/bin/cquery --test-unit
# Run index tests (index_tests/**)
build/debug/bin/cquery --test-index

Naming Convention

Follow existing style, but generally:

struct MyStruct {
  void MyMethod(MyStruct* a, const std::string& b);
  int some_value;

 private:
  MyStruct* rest_;
};

Header include order

Headers should go from most local to most global to expose any accidental dependency issues. For example,

// Associated header file with the cc file.
#include "foo.h"

// Local includes.
#include "platform.h"
#include "query.h"

// Third party libraries.
#include <doctest/doctest.h>
#include <rapidjson/rapidjson.h>

// STL
#include <string>
#include <vector>
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.