pmonks / clj-spdx Goto Github PK
View Code? Open in Web Editor NEWClojure wrapper around spdx/Spdx-Java-Library
License: Apache License 2.0
Clojure wrapper around spdx/Spdx-Java-Library
License: Apache License 2.0
SPDX v3.0 is currently in RC and a GA will likely be available soon, and while it mostly doesn't impact clj-spdx
(being mostly model changes, which this library doesn't yet implement), there will be some changes necessary, including:
AdditionRef
sThe Spdx-Java-Library is exceptionally expensive to initialise with the basic reference data (license and exception lists, templates etc.). On my laptop it generally takes more than a minute to pull this information down, parse it, and load it into memory.
There may be a way to cache the library's state to disk (e.g. via serialisation, perhaps using nippy
) and only incur the cost of initialisation when the lists have changes (which can be determined via an eTag request to the two list URLs).
(require '[spdx.expressions :as sexp])
(sexp/extract-ids (sexp/parse "GPL-2.0+"))
#{"GPL-2.0-or-later"}
#{"GPL-2.0"}
Currently the parse trees returned from spdx.expressions/parse
don't represent the precedence order for AND and OR (as specified in Annex D of the SPDX specification). Rather than leaving this to users of clj-spdx
, the library should explicitly represent operator precedence (i.e. by introducing grouping where it didn't exist in the original expression) to make it explicit.
For example, this SPDX expression:
GPL-3.0 OR MIT AND Apache-2.0
should be parsed to:
[{license-id "GPL-3.0-only"} :or [{license-id "MIT"} :and {license-id "Apache-2.0"}]]
Currently, when a valid but logically redundant expression such as:
"Apache-2.0 AND Apache-2.0"
is parsed, spdx.expressions/parse
returns:
[:and {:license-id "Apache-2.0"} {:license-id "Apache-2.0"}]
which is logically equivalent to:
{:license-id "Apache-2.0"}
An implementation of this simplification should be considered, controllable via an option (e.g. :collapse-redundant-clauses?
), and defaulting to true
(enabled).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.