Skip to content

Commit 90b650d

Browse files
hsnice16claude
andcommitted
feat: broaden tests signal to PHP, Ruby, C#
File regex now also recognises *Test.php (PHPUnit), *_test.rb / *_spec.rb (Minitest / RSpec), and *Tests?.cs (xUnit / NUnit / MSTest). Repos that nest tests in subdirectories (e.g. ASP.NET Core, Rails) now correctly hit the test signal even without a recognised root-level test directory. Sibling repos (agent-friendly-action, agent-friendly-skill) re-vendored and logged under their CHANGELOG.md "Unreleased" sections per AGENTS.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7c832bf commit 90b650d

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

lib/scoring/signals/tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { Signal } from "./types";
66

77
const DIRS = ["tests", "test", "__tests__", "spec", "specs", "Tests", "src/test"];
88
const FILE_RE =
9-
/(^|\/)(.*\.test\.|.*\.spec\.|test_.*\.py$|.*_test\.go$|.*_test\.rs$|.*Test\.java$|.*Tests?\.kt$|.*_test\.exs$|.*_test\.dart$|.*Spec\.scala$|.*Test\.scala$)/;
9+
/(^|\/)(.*\.test\.|.*\.spec\.|test_.*\.py$|.*_test\.go$|.*_test\.rs$|.*Test\.java$|.*Tests?\.kt$|.*_test\.exs$|.*_test\.dart$|.*Spec\.scala$|.*Test\.scala$|.*Test\.php$|.*_test\.rb$|.*_spec\.rb$|.*Tests?\.cs$)/;
1010

1111
export const tests: Signal = {
1212
id: "tests",

tests/signals/tests.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,24 @@ describe("tests signal", () => {
8383
fixture = makeFixture({ "src/main/scala/FooSpec.scala": "class FooSpec {}" });
8484
assert.equal(testsSignal.check(fixture).pass, 0.7);
8585
});
86+
87+
test("pass=0.7 for a PHP *Test.php file", () => {
88+
fixture = makeFixture({ "src/FooTest.php": "<?php class FooTest {}" });
89+
assert.equal(testsSignal.check(fixture).pass, 0.7);
90+
});
91+
92+
test("pass=0.7 for a Ruby *_test.rb file (Minitest)", () => {
93+
fixture = makeFixture({ "lib/foo_test.rb": "require 'minitest'" });
94+
assert.equal(testsSignal.check(fixture).pass, 0.7);
95+
});
96+
97+
test("pass=0.7 for a Ruby *_spec.rb file (RSpec)", () => {
98+
fixture = makeFixture({ "lib/foo_spec.rb": "describe Foo do\nend" });
99+
assert.equal(testsSignal.check(fixture).pass, 0.7);
100+
});
101+
102+
test("pass=0.7 for a C# *Tests.cs file", () => {
103+
fixture = makeFixture({ "src/Foo/FooTests.cs": "class FooTests {}" });
104+
assert.equal(testsSignal.check(fixture).pass, 0.7);
105+
});
86106
});

0 commit comments

Comments
 (0)