| ... | @@ -3,7 +3,7 @@ pub const licenses = @import("licenses-text"); | ... | @@ -3,7 +3,7 @@ pub const licenses = @import("licenses-text"); |
| 3 | const leven = @import("leven"); | 3 | const leven = @import("leven"); |
| 4 | const fscheck = @import("fs-check"); | 4 | const fscheck = @import("fs-check"); |
| 5 | | 5 | |
| 6 | pub fn detect(alloc: *std.mem.Allocator, license_src: []const u8) ![]const u8 { | 6 | pub fn detect(alloc: std.mem.Allocator, license_src: []const u8) ![]const u8 { |
| 7 | var min: ?usize = null; | 7 | var min: ?usize = null; |
| 8 | var ind: ?usize = null; | 8 | var ind: ?usize = null; |
| 9 | | 9 | |
| ... | @@ -19,7 +19,7 @@ pub fn detect(alloc: *std.mem.Allocator, license_src: []const u8) ![]const u8 { | ... | @@ -19,7 +19,7 @@ pub fn detect(alloc: *std.mem.Allocator, license_src: []const u8) ![]const u8 { |
| 19 | return licenses.spdx[ind.?][0]; | 19 | return licenses.spdx[ind.?][0]; |
| 20 | } | 20 | } |
| 21 | | 21 | |
| 22 | pub fn detectInDir(alloc: *std.mem.Allocator, dir: std.fs.Dir) !?[]const u8 { | 22 | pub fn detectInDir(alloc: std.mem.Allocator, dir: std.fs.Dir) !?[]const u8 { |
| 23 | const lic_filename = (try testLicenseFile(dir, "LICENSE")) orelse | 23 | const lic_filename = (try testLicenseFile(dir, "LICENSE")) orelse |
| 24 | (try testLicenseFile(dir, "LICENSE.md")) orelse | 24 | (try testLicenseFile(dir, "LICENSE.md")) orelse |
| 25 | null; | 25 | null; |