Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pkgs/tools/nix/nixos-option/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Checks:
- bugprone-*
# don't find them too problematic
- -bugprone-easily-swappable-parameters
- performance-*
- modernize-*
# doesn't improve readability much in this project
- -modernize-use-trailing-return-type
- readability-*
# don't find them too problematic
- -readability-identifier-length
- -readability-magic-numbers
- portability-*
- concurrency-*
- google-*
- -google-readability-todo
- misc-*
# we maybe want to address this?
- -misc-no-recursion
- cppcoreguidelines-*
- -cppcoreguidelines-avoid-magic-numbers
# We could use std::reference_wrapper, but it's not super important
- -cppcoreguidelines-avoid-const-or-ref-data-members
UseColor: true
CheckOptions:
misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: True
1 change: 1 addition & 0 deletions pkgs/tools/nix/nixos-option/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
7 changes: 7 additions & 0 deletions pkgs/tools/nix/nixos-option/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
with import ../../../.. { };
nixos-option.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [
# hiprio so that it has a higher priority than the default unwrapped clang tools from clang if our stdenv is based on clang
(lib.hiPrio pkgs.buildPackages.clang-tools)
];
})
7 changes: 5 additions & 2 deletions pkgs/tools/nix/nixos-option/src/libnix-copy-paste.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
// Since they are not, copy/paste them here.
// TODO: Delete these and use the ones in the library as they become available.

#include <string_view>
#include "libnix-copy-paste.hh"
#include <nix/print.hh> // for Strings
#include <nix/print.hh>

// NOLINTBEGIN
// From nix/src/nix/repl.cc
bool isVarName(const std::string_view & s)
bool isVarName(std::string_view s)
{
if (s.size() == 0) return false;
if (nix::isReservedKeyword(s)) return false;
Expand All @@ -20,3 +22,4 @@ bool isVarName(const std::string_view & s)
return false;
return true;
}
// NOLINTEND
4 changes: 2 additions & 2 deletions pkgs/tools/nix/nixos-option/src/libnix-copy-paste.hh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#include <nix/types.hh>
#include <string_view>

bool isVarName(const std::string_view & s);
bool isVarName(std::string_view s);
Loading