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
6 changes: 4 additions & 2 deletions .dscanner.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; Configure which static analysis checks are enabled
[analysis.config.StaticAnalysisConfig]
[dscanner.analysis.config.StaticAnalysisConfig]
; Check variable, class, struct, interface, union, and function names against
; the Phobos style guide
style_check="enabled"
Expand Down Expand Up @@ -93,6 +93,8 @@ redundant_attributes_check="enabled"
has_public_example="enabled"
; Check for asserts without an explanatory message
assert_without_msg="skip-unittest"
; Check indent of if constraints
if_constraints_indent="enabled"

; Configure which modules are checked with a specific checker
; Please help to extend these checks onto more Phobos modules
Expand All @@ -106,7 +108,7 @@ assert_without_msg="skip-unittest"
;
; Some checks are currently disabled.
; For more details, please see https://github.com/dlang/phobos/pull/5501
[analysis.config.ModuleFilters]
[dscanner.analysis.config.ModuleFilters]
; Check for uses of the old-style alias syntax
alias_syntax_check="-std.traits,-std.typecons"
; Check allman brace style
Expand Down
2 changes: 1 addition & 1 deletion posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ ROOT_OF_THEM_ALL = generated
ROOT = $(ROOT_OF_THEM_ALL)/$(OS)/$(BUILD)/$(MODEL)
DUB=dub
TOOLS_DIR=../tools
DSCANNER_HASH=a230e0fcb166d975cfda168e05a6156dd7db1b41
DSCANNER_HASH=ef9853215d61731f1a4d97d13618e4cb12c40c57
DSCANNER_DIR=$(ROOT_OF_THEM_ALL)/dscanner-$(DSCANNER_HASH)

# Set DRUNTIME name and full path
Expand Down
10 changes: 5 additions & 5 deletions std/algorithm/searching.d
Original file line number Diff line number Diff line change
Expand Up @@ -1378,8 +1378,8 @@ if (isInputRange!Range && !isInfinite!Range &&
}

private auto extremum(alias selector = "a < b", Range)(Range r)
if (isInputRange!Range && !isInfinite!Range &&
!is(typeof(unaryFun!selector(ElementType!(Range).init))))
if (isInputRange!Range && !isInfinite!Range &&
!is(typeof(unaryFun!selector(ElementType!(Range).init))))
{
return extremum!(a => a, selector)(r);
}
Expand All @@ -1388,9 +1388,9 @@ private auto extremum(alias selector = "a < b", Range)(Range r)
private auto extremum(alias selector = "a < b", Range,
RangeElementType = ElementType!Range)
(Range r, RangeElementType seedElement)
if (isInputRange!Range && !isInfinite!Range &&
!is(CommonType!(ElementType!Range, RangeElementType) == void) &&
!is(typeof(unaryFun!selector(ElementType!(Range).init))))
if (isInputRange!Range && !isInfinite!Range &&
!is(CommonType!(ElementType!Range, RangeElementType) == void) &&
!is(typeof(unaryFun!selector(ElementType!(Range).init))))
{
return extremum!(a => a, selector)(r, seedElement);
}
Expand Down
9 changes: 6 additions & 3 deletions std/concurrency.d
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,8 @@ private template isSpawnable(F, T...)
* pointer indirection. This is necessary for enforcing isolation among
* threads.
*/
Tid spawn(F, T...)(F fn, T args) if (isSpawnable!(F, T))
Tid spawn(F, T...)(F fn, T args)
if (isSpawnable!(F, T))
{
static assert(!hasLocalAliasing!(T), "Aliases to mutable thread-local data not allowed.");
return _spawn(false, fn, args);
Expand Down Expand Up @@ -504,7 +505,8 @@ Tid spawn(F, T...)(F fn, T args) if (isSpawnable!(F, T))
* Returns:
* A Tid representing the new thread.
*/
Tid spawnLinked(F, T...)(F fn, T args) if (isSpawnable!(F, T))
Tid spawnLinked(F, T...)(F fn, T args)
if (isSpawnable!(F, T))
{
static assert(!hasLocalAliasing!(T), "Aliases to mutable thread-local data not allowed.");
return _spawn(true, fn, args);
Expand All @@ -513,7 +515,8 @@ Tid spawnLinked(F, T...)(F fn, T args) if (isSpawnable!(F, T))
/*
*
*/
private Tid _spawn(F, T...)(bool linked, F fn, T args) if (isSpawnable!(F, T))
private Tid _spawn(F, T...)(bool linked, F fn, T args)
if (isSpawnable!(F, T))
{
// TODO: MessageList and &exec should be shared.
auto spawnTid = Tid(new MessageBox);
Expand Down
3 changes: 2 additions & 1 deletion std/conv.d
Original file line number Diff line number Diff line change
Expand Up @@ -5974,7 +5974,8 @@ if (isIntegral!T)
Returns the representation of an enumerated value, i.e. the value converted to
the base type of the enumeration.
*/
OriginalType!E asOriginalType(E)(E value) if (is(E == enum))
OriginalType!E asOriginalType(E)(E value)
if (is(E == enum))
{
return value;
}
Expand Down
3 changes: 2 additions & 1 deletion std/digest/crc.d
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ alias CRC64ISO = CRC!(64, 0xD800000000000000);
*
* See $(D std.digest.digest) for differences between template and OOP API.
*/
struct CRC(uint N, ulong P) if (N == 32 || N == 64)
struct CRC(uint N, ulong P)
if (N == 32 || N == 64)
{
private:
static if (N == 32)
Expand Down
4 changes: 2 additions & 2 deletions std/experimental/allocator/common.d
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ version(unittest)
}

package void testAllocatorObject(RCAllocInterface)(RCAllocInterface a)
if (is(RCAllocInterface == RCIAllocator)
|| is (RCAllocInterface == shared RCISharedAllocator))
if (is(RCAllocInterface == RCIAllocator)
|| is (RCAllocInterface == shared RCISharedAllocator))
{
import std.conv : text;
import std.math : isPowerOf2;
Expand Down
4 changes: 2 additions & 2 deletions std/numeric.d
Original file line number Diff line number Diff line change
Expand Up @@ -2610,7 +2610,7 @@ Returns:
The greatest common divisor of the given arguments.
*/
T gcd(T)(T a, T b)
if (isIntegral!T)
if (isIntegral!T)
{
static if (is(T == const) || is(T == immutable))
{
Expand Down Expand Up @@ -2667,7 +2667,7 @@ T gcd(T)(T a, T b)
// user-defined types.
/// ditto
T gcd(T)(T a, T b)
if (!isIntegral!T &&
if (!isIntegral!T &&
is(typeof(T.init % T.init)) &&
is(typeof(T.init == 0 || T.init > 0)))
{
Expand Down
4 changes: 2 additions & 2 deletions std/range/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -7808,7 +7808,7 @@ See_Also: $(LREF chunks)
*/
auto slide(Flag!"withPartial" f = Yes.withPartial,
Source)(Source source, size_t windowSize, size_t stepSize = 1)
if (isForwardRange!Source)
if (isForwardRange!Source)
{
return Slides!(f, Source)(source, windowSize, stepSize);
}
Expand Down Expand Up @@ -7871,7 +7871,7 @@ auto slide(Flag!"withPartial" f = Yes.withPartial,
}

private struct Slides(Flag!"withPartial" withPartial = Yes.withPartial, Source)
if (isForwardRange!Source)
if (isForwardRange!Source)
{
private:
Source source;
Expand Down
2 changes: 1 addition & 1 deletion std/regex/internal/backtracking.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import std.regex.internal.ir;
regular expressions.
+/
@trusted class BacktrackingMatcher(Char, Stream = Input!Char) : Matcher!Char
if (is(Char : dchar))
if (is(Char : dchar))
{
alias DataIndex = Stream.DataIndex;
struct State
Expand Down
Loading