Skip to content

Commit 35da27d

Browse files
bump ameba 1.6.4 (#33)
* bump ameba 1.6.4
1 parent 38a6211 commit 35da27d

32 files changed

Lines changed: 422 additions & 204 deletions

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
version: 2.1
22

33
orbs:
4-
codacy: codacy/base@10.8.0
5-
codacy_plugins_test: codacy/plugins-test@1.1.1
4+
codacy: codacy/base@12.1.5
5+
codacy_plugins_test: codacy/plugins-test@2.0.11
66

77
jobs:
88
unit_test:
99
docker: # run the steps with Docker
10-
- image: crystallang/crystal:1.8.2
10+
- image: crystallang/crystal:1.15
1111
working_directory: ~/workdir
1212
steps:
1313
- attach_workspace:

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
bin
33
lib
44
spec
5-
**/.DS_Store
5+
**/.DS_Store
6+
.idea/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/.shards/
44
*.dwarf
55
.DS_Store
6+
.idea/

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM crystallang/crystal:1.10.1-alpine as builder
1+
FROM crystallang/crystal:1.15-alpine as builder
22
WORKDIR /tmp/build
33
COPY . /tmp/build
4-
RUN shards build --production
4+
RUN shards build --production --release -Dpreview_mt
55

66
# To test on M1 macs use: --platform=linux/amd64
7-
FROM alpine:3.18
7+
FROM alpine:3.21
88
RUN apk add yaml pcre2 gc libevent libgcc
99
COPY docs /docs
1010
COPY --from=builder /tmp/build/bin/codacy-ameba /opt/app/

docs/description/Lint_Documentation.md renamed to docs/description/Documentation_Documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ modules, classes, enums, methods and macros.
44
YAML configuration example:
55

66
```
7-
Lint/Documentation:
7+
Documentation/Documentation:
88
Enabled: true
99
IgnoreClasses: false
1010
IgnoreModules: true
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
A rule that reports documentation admonitions.
2+
3+
Optionally, these can fail at an appropriate time.
4+
5+
```
6+
def get_user(id)
7+
# TODO(2024-04-24) Fix this hack when the database migration is complete
8+
if id < 1_000_000
9+
v1_api_call(id)
10+
else
11+
v2_api_call(id)
12+
end
13+
end
14+
```
15+
16+
`TODO` comments are used to remind yourself of source code related things.
17+
18+
The premise here is that `TODO` should be dealt with in the near future
19+
and are therefore reported by Ameba.
20+
21+
`FIXME` comments are used to indicate places where source code needs fixing.
22+
23+
The premise here is that `FIXME` should indeed be fixed as soon as possible
24+
and are therefore reported by Ameba.
25+
26+
YAML configuration example:
27+
28+
```
29+
Documentation/DocumentationAdmonition:
30+
Enabled: true
31+
Admonitions: [TODO, FIXME, BUG]
32+
Timezone: UTC
33+
```

docs/description/Lint_NotNilAfterNoBang.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
This rule is used to identify usage of `index/rindex/find` calls
1+
This rule is used to identify usage of `index/rindex/find/match` calls
22
followed by a call to `not_nil!`.
33

44
For example, this is considered a code smell:
55

66
```
7-
%w[Alice Bob].find(&.match(/^A./)).not_nil!
7+
%w[Alice Bob].find(&.chars.any?(&.in?('o', 'b'))).not_nil!
88
```
99

1010
And can be written as this:
1111

1212
```
13-
%w[Alice Bob].find!(&.match(/^A./))
13+
%w[Alice Bob].find!(&.chars.any?(&.in?('o', 'b')))
1414
```
1515

1616
YAML configuration example:

docs/description/Lint_PercentArrays.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ A rule that disallows some unwanted symbols in percent array literals.
33
For example, this is usually written by mistake:
44

55
```
6-
%i(:one, :two)
7-
%w("one", "two")
6+
%i[:one, :two]
7+
%w["one", "two"]
88
```
99

1010
And the expected example is:
1111

1212
```
13-
%i(one two)
14-
%w(one two)
13+
%i[one two]
14+
%w[one two]
1515
```
1616

1717
YAML configuration example:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
A rule that enforces spec filenames to have `_spec` suffix.
2+
3+
YAML configuration example:
4+
5+
```
6+
Lint/SpecFilename:
7+
Enabled: true
8+
IgnoredDirs: [spec/support spec/fixtures spec/data]
9+
IgnoredFilenames: [spec_helper]
10+
```

docs/description/Lint_Typos.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
A rule that reports typos found in source files.
2+
3+
NOTE: Needs [typos](https://github.com/crate-ci/typos) CLI tool.
4+
NOTE: See the chapter on [false positives](https://github.com/crate-ci/typos#false-positives).
5+
6+
YAML configuration example:
7+
8+
```
9+
Lint/Typos:
10+
Enabled: true
11+
BinPath: ~
12+
FailOnError: false
13+
```

0 commit comments

Comments
 (0)