<commit_before>FROM alpine:latest AS base

# We install and then uninstall quality to cache the dependencies
# while we still have the build tools installed but still be able to
# install the very latest quality gem later on without having the disk
# space impact of two versions.

RUN apk update && \
    apk add --no-cache ruby ruby-irb ruby-dev make gcc libc-dev git icu-dev zlib-dev g++ cmake openssl-dev coreutils && \
    gem install --no-ri --no-rdoc bigdecimal rake etc quality bundler io-console pronto pronto-reek pronto-rubocop pronto-flay 'bundler:<2' && \
    gem uninstall quality && \
    strip /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/rugged-*/rugged/rugged.so && \
    apk del ruby-irb ruby-dev make gcc libc-dev icu-dev zlib-dev g++ cmake openssl-dev nghttp2 curl pax-utils && \
    apk add --no-cache libssl1.1 icu-libs && \
    rm -fr /usr/lib/ruby/gems/2.5.0/gems/rugged-0.27.4/vendor/libgit2/build/src \
           /usr/lib/ruby/gems/2.5.0/gems/rugged-0.27.4/vendor/libgit2/src \
           /usr/lib/ruby/gems/2.5.0/gems/rugged-0.27.4/ext/rugged \
           /usr/lib/ruby/gems/2.5.0/gems/rugged-0.27.4/vendor/libgit2/build/libgit2.a \
           /usr/lib/ruby/gems/2.5.0/gems/rugged-0.27.4/lib/rugged/rugged.so \
           /usr/lib/ruby/gems/2.5.0/gems/unf_ext-0.0.7.5/ext/unf_ext/unf \
           /usr/lib/ruby/gems/2.5.0/gems/kramdown-1.17.0/test \
           /usr/lib/ruby/gems/2.5.0/gems/ruby_parser-3.11.0/lib/*.y \
           /usr/lib/ruby/gems/2.5.0/gems/ruby_parser-3.11.0/lib/*.yy \
           /usr/lib/ruby/gems/2.5.0/gems/ruby_parser-3.11.0/lib/*.rex \
           /usr/lib/ruby/gems/2.5.0/cache \
           /usr/lib/ruby/gems/2.5.0/gems/erubis-2.7.0/doc-api \
           /usr/lib/ruby/gems/2.5.0/gems/reek-5.0.2/spec \
           /usr/lib/ruby/gems/2.5.0/gems/kwalify-0.7.2/doc-api \
      && \
      echo "Done"

RUN mkdir /usr/quality
ADD sample-project/.pronto.yml /usr/quality/.pronto.yml
ADD sample-project/Rakefile /usr/quality/Rakefile
COPY entrypoint.sh /


FROM base AS latest
VOLUME /usr/app
WORKDIR /usr/app
ENTRYPOINT ["/entrypoint.sh"]
ARG quality_gem_version
RUN gem install --no-ri --no-rdoc quality:${quality_gem_version}
CMD ["quality"]



FROM base AS python-base
#
# Install flake8 and pycodestyle
#

RUN apk add --no-cache python3 py3-pip && \
    pip3 install flake8 && \
    apk del py3-pip && \
    pip3 uninstall -y pip

# pronto-flake8 doesn't have an official release whose gemspec allows
# pronto 0.10.0 as of yet, so let's install the fixed version from GitHub:
#
# https://github.com/scoremedia/pronto-flake8/pull/7
#
# RUN gem install --no-ri --no-rdoc pronto-flake8
RUN gem install --no-ri --no-rdoc specific_install && gem specific_install -l https://github.com/scoremedia/pronto-flake8


FROM python-base AS python
VOLUME /usr/app
WORKDIR /usr/app
ENTRYPOINT ["/entrypoint.sh"]
ARG quality_gem_version
RUN gem install --no-ri --no-rdoc quality:${quality_gem_version}
CMD ["quality"]


<commit_msg>Forked pronto-flake8 fixes in Dockerfile (#124)<commit_after>FROM alpine:latest AS base

# We install and then uninstall quality to cache the dependencies
# while we still have the build tools installed but still be able to
# install the very latest quality gem later on without having the disk
# space impact of two versions.

RUN apk update && \
    apk add --no-cache ruby ruby-irb ruby-dev make gcc libc-dev git icu-dev zlib-dev g++ cmake openssl-dev coreutils && \
    gem install --no-ri --no-rdoc bigdecimal rake etc quality bundler io-console pronto pronto-reek pronto-rubocop pronto-flay 'bundler:<2' && \
    gem uninstall quality && \
    strip /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/rugged-*/rugged/rugged.so && \
    apk del ruby-irb ruby-dev make gcc libc-dev icu-dev zlib-dev g++ cmake openssl-dev nghttp2 curl pax-utils && \
    apk add --no-cache libssl1.1 icu-libs && \
    rm -fr /usr/lib/ruby/gems/2.5.0/gems/rugged-0.27.4/vendor/libgit2/build/src \
           /usr/lib/ruby/gems/2.5.0/gems/rugged-0.27.4/vendor/libgit2/src \
           /usr/lib/ruby/gems/2.5.0/gems/rugged-0.27.4/ext/rugged \
           /usr/lib/ruby/gems/2.5.0/gems/rugged-0.27.4/vendor/libgit2/build/libgit2.a \
           /usr/lib/ruby/gems/2.5.0/gems/rugged-0.27.4/lib/rugged/rugged.so \
           /usr/lib/ruby/gems/2.5.0/gems/unf_ext-0.0.7.5/ext/unf_ext/unf \
           /usr/lib/ruby/gems/2.5.0/gems/kramdown-1.17.0/test \
           /usr/lib/ruby/gems/2.5.0/gems/ruby_parser-3.11.0/lib/*.y \
           /usr/lib/ruby/gems/2.5.0/gems/ruby_parser-3.11.0/lib/*.yy \
           /usr/lib/ruby/gems/2.5.0/gems/ruby_parser-3.11.0/lib/*.rex \
           /usr/lib/ruby/gems/2.5.0/cache \
           /usr/lib/ruby/gems/2.5.0/gems/erubis-2.7.0/doc-api \
           /usr/lib/ruby/gems/2.5.0/gems/reek-5.0.2/spec \
           /usr/lib/ruby/gems/2.5.0/gems/kwalify-0.7.2/doc-api \
      && \
      echo "Done"

RUN mkdir /usr/quality
ADD sample-project/.pronto.yml /usr/quality/.pronto.yml
ADD sample-project/Rakefile /usr/quality/Rakefile
COPY entrypoint.sh /


FROM base AS latest
VOLUME /usr/app
WORKDIR /usr/app
ENTRYPOINT ["/entrypoint.sh"]
ARG quality_gem_version
RUN gem install --no-ri --no-rdoc quality:${quality_gem_version}
CMD ["quality"]



FROM base AS python-base
#
# Install flake8 and pycodestyle
#

RUN apk add --no-cache python3 py3-pip && \
    pip3 install flake8 && \
    apk del py3-pip && \
    pip3 uninstall -y pip

# pronto-flake8 doesn't have an official release whose gemspec allows
# pronto 0.10.0 as of yet, so let's install the fixed version from GitHub:
#
# https://github.com/scoremedia/pronto-flake8/pull/7
#
# RUN gem install --no-ri --no-rdoc pronto-flake8
RUN gem install --no-ri --no-rdoc specific_install && gem specific_install -l https://github.com/apiology/pronto-flake8 -b relax_pronto_requirement



FROM python-base AS python
VOLUME /usr/app
WORKDIR /usr/app
ENTRYPOINT ["/entrypoint.sh"]
ARG quality_gem_version
RUN gem install --no-ri --no-rdoc quality:${quality_gem_version}
CMD ["quality"]



{'fraction_non_alphanumeric': 0.14798206278026907, 'fraction_numerical': 0.04218568344128882, 'mean_word_length': 2.507280139778684, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3887472', 'n_tokens_mistral': 2513, 'n_tokens_neox': 2302, 'n_words': 477}