1/nektro/detect-license v0.5

Given an input text guess which SPDX license it most likely is an instance of


zig-detect-license

Given an input text guess which SPDX license it most likely is an instance of

Built With

  • https://github.com/ziglang/zig master

  • https://github.com/nektro/zigmod package manager

  • https://github.com/nektro/zig-licenses-text

  • https://github.com/nektro/zig-leven

  • https://github.com/nektro/zig-fs-check

Install

zigmod aq add 1/nektro/detect-license

Usage

  • pub fn detect(alloc: *std.mem.Allocator, license_src: []const u8) ![]const u8

    • Given an input string, will return the SPDX licence identifier for the closest guess to which one it might be
  • pub fn detectInDir(alloc: *std.mem.Allocator, dir: std.fs.Dir) !?[]const u8

    • Given a directory, will search for a LICENSE file and return the guess for which one it is. Will return null if the license file can not be found. If this returns null when you do indeed have a license file, please help expand the search examples by submitting a bug report.

License

MIT

Package Contents

  • .gitattributes
  • LICENSE
  • build.zig
  • src/lib.zig
  • src/main.zig
  • README.md
  • zig.mod
  • .gitignore

Dependencies

  • git https://github.com/nektro/zig-licenses-text
  • git https://github.com/nektro/zig-leven

History

Published On Tree @ Commit Size
v0.7 Sat, 07 Sep 2024 23:12:58 UTC Tree 4.640 KB
v0.6 Thu, 10 Aug 2023 08:47:20 UTC Tree 4.618 KB
v0.5 Mon, 20 Mar 2023 18:39:56 UTC Tree 4.556 KB
v0.4 Sun, 06 Feb 2022 02:33:45 UTC Tree 4.551 KB
v0.3 Fri, 24 Dec 2021 19:42:30 UTC Tree 5.457 KB
v0.2 Sat, 31 Jul 2021 02:00:14 UTC Tree 5.459 KB
v0.1 Wed, 28 Jul 2021 07:06:57 UTC Tree 5.455 KB