Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

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>