Skip to content

Style/cpplint fixes - #28

Merged
vjan-nie merged 4 commits into
Univers42:mainfrom
vjan-nie:style/cpplint-fixes
Aug 7, 2026
Merged

Style/cpplint fixes#28
vjan-nie merged 4 commits into
Univers42:mainfrom
vjan-nie:style/cpplint-fixes

Conversation

@vjan-nie

@vjan-nie vjan-nie commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

style: apply cpplint fixes, filter what conflicts with 42/C++98

Second phase of the team style adoption (after the clang-format PR).
Runs cpplint (Google style) and resolves every finding under an explicit
priority order: 42's subject > C++98 > project decisions > Google style.
Google is an adopted baseline of good practices, overridden wherever a
higher layer conflicts.

Adopted (applied to the code)

  • runtime/explicitBot(Server*) marked explicit; prevents accidental
    implicit conversion of a Server* into a Bot.
  • readability/braces — three if/else made brace-symmetric; prevents the
    "second statement silently outside the else" class of bug.
  • include_what_you_useFancyLogSink.hpp now includes <string>
    directly instead of relying on a transitive include.
  • build/include_order — 8 files regrouped into Google's ordering
    (own header, C system, C++ system, project), which also verifies each
    header is self-contained. All compiled clean → headers were already
    autonomous.

Filtered (documented in CPPLINT.cfg, each a higher-authority conflict)

  • legal/copyright — 42 projects don't carry copyright headers.
  • build/include_subdir — a Google-monorepo include-path convention, N/A
    to this tree.
  • build/header_guard — Google wants path-based guards
    (INCLUDE_CLIENT_HPP_); 42's CPP modules expect header/source name parity
    and short guards, and there are no cross-directory name collisions, so the
    path convention solves a problem we don't have.
  • runtime/references — passing by const reference is idiomatic C++;
    Google's pointer-for-mutables rule is a call-site house preference.
  • runtime/int — fixed-width types aren't guaranteed in strict C++98;
    the subject uses int/size_t/time_t.

Verification

cpplint clean (exit 0), three tiers -Werror clean, full suite 511/511, no
regression. Config lives in CPPLINT.cfg (cpplint 1.6.1 reads that, not
.cpplintrc) with the rationale inline.

Responds to issue #22

@vjan-nie
vjan-nie merged commit 08e7847 into Univers42:main Aug 7, 2026
@vjan-nie vjan-nie mentioned this pull request Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant