Giter Site home page Giter Site logo

ekkolon / licensa Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 532 KB

Seamless source code license management from your command line

License: Apache License 2.0

Rust 91.73% PowerShell 6.72% Shell 1.55%
cli command-line-tool license-management licensing spdx-licenses

licensa's People

Contributors

ekkolon avatar foorack avatar

Watchers

 avatar

licensa's Issues

feat: use spdx crate to verify and render spdx expressions

Description

Right now, we are only handling license IDs from the choosealicense repository, yet we could use the spdx crate for that. Additionally, the approach used right now isn't robust and fails validation even though license expressions provided by the user are valid SPDX expressions.

For example, executing the following command fails:

licensa apply --type "MIT or Apache-2.0"

We should allow the user to provide 'imprecise' license ids, since the spdx crate provides a nice function to infer valid SPDX ids from them.

In cases where the user supplies an imprecise license ID for which one or more valid SPDX ids can be inferred, we should prompt the user to select and confirm the valid license id.

This could look like this:

licensa apply --type "BSD"
...

# Select and confirm license id 

Which kind of BSD license would you like to use?:

- BSD-1-Clause
- BSD-2-Clause
- BSD-3-Clause
...etc

Tasks

  • Add function that takes as input a string and returns a result containing the list of inferred license ids. An error indicates that the provided id is invalid
  • Add prompt functionality using the inquirer crate

feat(cli): add CLI `--dry-run` flag

Description:

Objective:
Implement a --dry-run flag in the CLI to allow users to simulate the licensing process without making actual changes to files.

Features:

  • Introduce a --dry-run flag for the CLI.
  • When the --dry-run flag is used, the CLI should output the intended changes without applying them.
  • Ensure that the dry run accurately reflects the actions that would be taken during a regular run.

Motivation:

  • Users may want to preview the changes the CLI will make before applying them.
  • Enhances user confidence in the licensing process.

Tasks:

  • CLI Modification:

    • Add support for the --dry-run flag in the CLI parsing logic.
  • Simulation Output:

    • Implement the logic to simulate the licensing process without actually modifying files.
    • Output the intended changes to the console.
  • Documentation:

    • Update the CLI documentation to include information about the new --dry-run flag.
    • Provide examples and usage instructions.
  • Testing:

    • Create test cases to ensure that the --dry-run flag functions as expected.
    • Include tests for various scenarios, including different licensing configurations.

refactor(cli): improve code organization

Right now, we have functionality split all over the place. Although this is fine for the moment, due to the many changes that are made rapidly to the repo, this is not a viable option for the future.

We should split our code into logical units to reduce complexcity and ultimately improve maintainability.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.