Code Monkey home page Code Monkey logo

Comments (9)

johnmhoran avatar johnmhoran commented on August 26, 2024

@majurg What labels would you like to use? We could use license added and license removed, but these don't seem to convey the binary nature of what we want to indicate, i.e., that the new/old file has/had no license info.

from deltacode.

steven-esser avatar steven-esser commented on August 26, 2024

We can probably just use license info added and license info removed for now.

from deltacode.

johnmhoran avatar johnmhoran commented on August 26, 2024

OK.

from deltacode.

johnmhoran avatar johnmhoran commented on August 26, 2024

@majurg Note that, as expected, this new category will be triggered if, for example, one side of the Delta pair has license scores all of which are below the cutoff_score and the other side has at least one license score >= the cutoff_score.

from deltacode.

steven-esser avatar steven-esser commented on August 26, 2024

@johnmhoran That sounds good. It should also work when one side is missing license info and the other has license info, regardless of score.

from deltacode.

johnmhoran avatar johnmhoran commented on August 26, 2024

I'm glad you mentioned that, @majurg . That adds a slight wrinkle to the new structure of _license_diff() but I think I have in mind a straightforward way to handle it.

This test, for example, currently passes, and we'd also want it to pass if the old_file score were < the cutoff_score:

    def test_Delta_license_diff_new_no_license_info(self):
        new_file = models.File({'path': 'new/path.txt'})
        old_file = models.File({'path': 'old/path.txt', 'licenses': [{'key': 'mit', 'score': 50.0}]})

        result = deltacode.Delta(new_file, old_file, 'modified')

        assert result.category == 'license info removed'

from deltacode.

steven-esser avatar steven-esser commented on August 26, 2024

yes

from deltacode.

steven-esser avatar steven-esser commented on August 26, 2024

This is ready for a PR, feel free to open at your convenience.

from deltacode.

steven-esser avatar steven-esser commented on August 26, 2024

merged #39, closing.

from deltacode.

Related Issues (20)

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.