aboutcode-org / aboutcode-org/scancode-toolkit

Extra `.freeze` left in parsing gemspec files

Đang mở
#2,513 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
2.6k
Fork
791
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
5

Mô tả

### Description

> Please leave a brief description of the bug or feature request:

### How To Reproduce

> Tell us how to reproduce the issue.

Run [docker pipeline](https://scancodeio.readthedocs.io/en/latest/scanpipe-tutorial-1.html) in scancode.io on a docker image created by building from this Dockerfile:

```
FROM ubuntu:20.04
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential libyaml-dev libreadline-dev \
zlib1g-dev libncurses5-dev libffi-dev libgdbm6 \
libgdbm-dev libssl-dev libxext6 libxml2-dev \
binutils ca-cacert wget unzip
WORKDIR /tmp
RUN wget --no-check-certificate https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.zip \
&& unzip -q ruby-2.7.2.zip \
&& cd /tmp/ruby-2.7.2 \
&& bash configure && make && make install
RUN gem update --no-document --system && gem install --no-document bundle
```

This is essentially a bug in [this function](https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/rubygems.py#L603).

Sample .gemspec file for consideration, taken from `/usr/lib/ruby/gems/2.7.0/specifications/default/benchmark-0.1.0.gemspec` from my local machine.

```
# -*- encoding: utf-8 -*-
# stub: benchmark 0.1.0 ruby lib

Gem::Specification.new do |s|
s.name = "benchmark".freeze
s.version = "0.1.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "homepage_uri" => "https://github.com/ruby/benchmark", "source_code_uri" => "https://github.com/ruby/benchmark" } if s.respond_to? :metadata=
s.require_paths = ["lib".freeze]
s.authors = ["Yukihiro Matsumoto".freeze]
s.bindir = "exe".freeze
s.date = "2021-04-15"
s.description = "a performance benchmarking library".freeze
s.email = ["matz@ruby-lang.org".freeze]
s.files = ["benchmark.rb".freeze, "benchmark/version.rb".freeze]
s.homepage = "https://github.com/ruby/benchmark".freeze
s.licenses = ["BSD-2-Clause".freeze]
s.rubygems_version = "3.1.2".freeze
s.summary = "a performance benchmarking library".freeze
end
```

### System configuration

> For bug reports, it really helps us to know:

* What OS are you running on? (Windows/MacOS/Linux) Ubuntu20.04
* What version of scancode-toolkit was used to generate the scan file? 21.3.31
* What installation method was used to install/run scancode? via scancode.io installation

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.