首页 > 解决方案 > 如何防止cpplint报告错误的包括顺序?

问题描述

标头.hpp:

#pragma once

#include <path/to/file.h>

#include <algorithm>
#include <chrono>
#include <memory>
#include <optional>
#include <string>
#include <vector>

当我运行 cpplint.py 时,我得到Found C system header after C++ system header. Should be: helpers.h, c system, c++ system, other. [build/include_order] [4],指向<optional>

是否可以在不禁用的情况下防止cpplint.py这样做build/include_order

注意:<optional>是c++17,cpplintafaik不支持。

你可以在这里下载我的 cpplint 版本:https ://raw.githubusercontent.com/google/styleguide/305ac87/cpplint/cpplint.py

提交到 GitHub Cpplint 的问题: https ://github.com/cpplint/cpplint/issues/138

标签: c++lintcpplint

解决方案


推荐阅读