-
Notifications
You must be signed in to change notification settings - Fork 37
/
mathbits.yml
23 lines (23 loc) · 980 Bytes
/
mathbits.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
rules:
- id: use-math-bits
patterns:
- pattern-either:
- pattern: $X >> $N | $X << (8 - $N)
- pattern: $X << $N | $X >> (8 - $N)
- pattern: $X >> (8 - $N) | $X << $N
- pattern: $X << (8 - $N) | $X >> $N
- pattern: $X >> $N | $X << (16 - $N)
- pattern: $X << $N | $X >> (16 - $N)
- pattern: $X >> (16 - $N) | $X << $N
- pattern: $X << (16 - $N) | $X >> $N
- pattern: $X >> $N | $X << (32 - $N)
- pattern: $X << $N | $X >> (32 - $N)
- pattern: $X >> (32 - $N) | $X << $N
- pattern: $X << (32 - $N) | $X >> $N
- pattern: $X >> $N | $X << (64 - $N)
- pattern: $X << $N | $X >> (64 - $N)
- pattern: $X >> (64 - $N) | $X << $N
- pattern: $X << (64 - $N) | $X >> $N
message: "Try using math/bits instead"
languages: [go]
severity: ERROR