Repository navigation
Added test-tidy for dependent licenses. - #12511
Conversation
|
Heads up! This PR modifies the following files:
|
| lines = f.read().splitlines(True) | ||
| for idx, line in enumerate(lines): | ||
| for license in licenses_dep_toml: | ||
| ok_licensed |= (license in line) |
There was a problem hiding this comment.
Not sure whether license would be a valid name. It's a built-in function :)
There was a problem hiding this comment.
Renamed to license_line.
|
BTW, the progress indicator isn't printing correctly: what is the magic I should be using? |
| 'license = "MIT / Apache-2.0"', | ||
| 'license = "MIT OR Apache-2.0"', | ||
| 'license = "MIT"', | ||
| 'license = "MIT"', |
|
The Also, it would be good to have the lint run even if progress is |
|
But, the |
| print '\nRunning the dependency licensing lint...' | ||
| for root, directories, filenames in os.walk(".cargo"): | ||
| if progress: | ||
| filenames = progress_wrapper(filenames) |
There was a problem hiding this comment.
Yep, I missed this. As Aneesh said, this should be
filenames = progress_wrapper(filenames) if progress else filenamesThere was a problem hiding this comment.
Fixed. (Also fixed the indentation, bah humbug emacs python mode.)
|
@Wafflespeanut I'd prefer to use iterators everywhere (for reduced memory usage), but your call. At the very least, I think we should still accept regular iterators as input to |
|
How come do we have to do something similar to grep when we could read the files as TOML files from Python? |
|
Yay, the progress meter now works! |
|
@nox: it would be a bit cleaner to parse the toml file, but would probably use a bit more memory unless there's a clever streaming toml parser out there. |
|
#12507 has landed, so we should be able to land this one. @larsbergstrom? |
|
Reviewed 2 of 2 files at r3. Comments from Reviewable |
|
looks good! squash and r=me |
e003c73 to
536314b
Compare
|
Squashed. @bors-servo r=larsbergstrom |
|
📌 Commit 536314b has been approved by |
Add a test-tidy lint for dependency licenses. Note that #12507 should land first.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is