diff --git a/.ameba.yml b/.ameba.yml
new file mode 100644
index 000000000000..a88029fe0b88
--- /dev/null
+++ b/.ameba.yml
@@ -0,0 +1,130 @@
+# Global
+
+Excluded:
+ - src/unicode/data.cr
+ - src/openssl/lib_crypto.cr
+
+# Metrics
+
+Metrics/CyclomaticComplexity:
+ Enabled: false
+
+# Documentation
+
+Documentation/DocumentationAdmonition:
+ Enabled: false
+
+# Naming
+
+Naming/BlockParameterName:
+ Enabled: false
+
+Naming/BinaryOperatorParameterName:
+ Enabled: false
+
+Naming/ConstantNames:
+ Excluded:
+ - src/lib_c/x86_64-windows-msvc/**/*
+ - src/lib_c/aarch64-android/**/*
+
+Naming/TypeNames:
+ Excluded:
+ - src/lib_c/**/*
+ - src/llvm/abi/**/*
+ - src/float/printer/**/*
+ - src/time/format/custom/**/*
+
+Naming/MethodNames:
+ Excluded:
+ - samples/spectral-norm.cr
+ - src/crystal/system/win32/time.cr
+
+Naming/VariableNames:
+ Excluded:
+ - samples/spectral-norm.cr
+ - src/lib_c/**/*
+ - src/float/printer/**/*
+ - src/crystal/system/win32/time.cr
+ - src/crystal/system/win32/delay_load.cr
+ - src/xml/libxml2.cr
+
+# Lint
+
+Lint/Typos:
+ Enabled: false
+
+Lint/ShadowingOuterLocalVar:
+ Enabled: false
+
+Lint/NotNil:
+ Enabled: false
+
+Lint/UnusedArgument:
+ Enabled: false
+
+Lint/DebuggerStatement:
+ Excluded:
+ - spec/debug/**/*
+
+Lint/DebugCalls:
+ Excluded:
+ - scripts/generate_windows_zone_names.cr
+ - samples/**/*
+ - spec/std/pp_spec.cr
+ - src/kernel.cr
+
+Lint/UselessAssign:
+ Excluded:
+ - scripts/generate_grapheme_properties.cr
+ - scripts/generate_unicode_data.cr
+ - samples/mt_gc_test.cr
+ - spec/debug/**/*
+ - spec/std/concurrent/select_spec.cr
+ - spec/std/weak_ref_spec.cr
+ - src/crystal/system/unix/syscall.cr
+
+Lint/LiteralInInterpolation:
+ Excluded:
+ - spec/compiler/formatter/formatter_spec.cr
+ - spec/std/string_spec.cr
+ - spec/std/random_spec.cr
+
+Lint/LiteralInCondition:
+ Excluded:
+ - spec/std/range_spec.cr
+
+Lint/LiteralsComparison:
+ Excluded:
+ - spec/std/int_spec.cr
+ - spec/std/tuple_spec.cr
+ - spec/std/char_spec.cr
+ - spec/std/regex_spec.cr
+
+Lint/RandZero:
+ Excluded:
+ - spec/std/random_spec.cr
+
+Lint/SpecFocus:
+ Excluded:
+ - spec/compiler/parser/parser_spec.cr
+
+Lint/SpecFilename:
+ Excluded:
+ - spec/llvm-ir/**/*
+ - spec/compiler/crystal_path/**/*
+
+# Style
+
+Style/WhileTrue:
+ Enabled: false
+
+Style/NegatedConditionsInUnless:
+ Enabled: false
+
+Style/VerboseBlock:
+ ExcludeOperators: true
+ ExcludeSetters: true
+
+Style/RedundantNext:
+ Excluded:
+ - src/crystal/system/win32/**/*
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index f395cf657082..1c9c43b382c2 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -107,6 +107,23 @@ jobs:
- name: Check Format
run: bin/ci format
+ run_ameba:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Install latest Crystal version
+ uses: crystal-lang/install-crystal@v1
+ with:
+ crystal: latest
+
+ - name: Download Crystal source
+ uses: actions/checkout@v4
+
+ - name: Install dependencies
+ run: shards install
+
+ - name: Run Ameba linter
+ run: bin/ameba
+
deploy_api_docs:
if: github.repository_owner == 'crystal-lang' && github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
diff --git a/shard.lock b/shard.lock
index e7f2ddc86d10..2b05f5045ab7 100644
--- a/shard.lock
+++ b/shard.lock
@@ -1,5 +1,9 @@
version: 2.0
shards:
+ ameba:
+ git: https://github.com/crystal-ameba/ameba.git
+ version: 1.6.1+git.commit.6d03cef6dfd0f52faf19bbcd47d14831db4d7834
+
markd:
git: https://github.com/icyleaf/markd.git
version: 0.5.0
diff --git a/shard.yml b/shard.yml
index 396d91bdffe2..23cb9c5bdbc8 100644
--- a/shard.yml
+++ b/shard.yml
@@ -16,6 +16,11 @@ dependencies:
github: I3oris/reply
commit: 90a7eb5a76048884d5d56bf6b9369f1e67fdbcd7
+development_dependencies:
+ ameba:
+ github: crystal-ameba/ameba
+ commit: 6d03cef6dfd0f52faf19bbcd47d14831db4d7834
+
license: Apache-2.0
repository: https://github.com/crystal-lang/crystal