Skip to content

Commit

Permalink
CHROMIUM: Merge 'upstream/master' into chromeos-0.7
Browse files Browse the repository at this point in the history
Merge of upstream through 5c7d812

Conflicts:
	src/ShellCheck/Analytics.hs

Manual changes:
        Cleaned up mintor conflicts in variables with spaces lists.

Changelog:
----------------------------------------------------------------
Benjamin Gordon (12):
      CHROMIUM: Exclude from CQ
      CHROMIUM: Initial support for portage
      CHROMIUM: Disable SC2155 for portage files
      CHROMIUM: Make SC2164 recommend die when running in portage
      CHROMIUM: Add predefined portage variables
      CHROMIUM: Add OWNERS file
      CHROMIUM: Add eclass variables to portage lists
      CHROMIUM: Don't warn about missing find paths in portage
      CHROMIUM: Add more internal portage variables
      CHROMIUM: Disable SC2016 for python_gen_any_dep
      CHROMIUM: Exempt more commands from single quote warnings
      SC2256: Check for translated strings matching known variables

David Burger (1):
      Remove binhost-pre-cq from COMMIT-QUEUE.ini.

Laurent VERDOÏA (1):
      Make image build process a bit simpler

Merlin Göttlinger (1):
      Nix install instructions

Supanat Pothivarakorn (1):
      Allow `read -t 0` to not require -r flag

Vidar Holen (29):
      Make `-f diff` stop saying it found more issues when it didn't.
      Update TravisCI config for new winghc docker image
      Remove _cleanup now that builds don't run in sequence
      Suggest quoting case patterns, as for SC2053 (fixes koalaman#1682)
      Fix glob range duplicate warning in [!!] (fixes koalaman#1706)
      Suggest using `$((..))` in `[ 2*3 -eq 6 ]` (fixes koalaman#1641)
      Merge branch 'read-t-0' of https://github.com/iboss-ptk/shellcheck into iboss-ptk-read-t-0
      Make `read -t 0` test more forgiving towards other flags
      Move failing test to correct check
      Merge branch 'iboss-ptk-read-t-0'
      Warn about unexpected characters after ]/]] (fixes koalaman#1680)
      Use single quotes for the format string example in SC2059
      Correctly handle empty variables for SC2086 (fixes koalaman#1722)
      Warn about [ x -ot y ] in POSIX mode
      Only trigger SC1014 when command is a complete word (fixes koalaman#1737)
      For SC2256, make sure the complete string is a variable name
      Merge branch 'translatedVars'
      Merge pull request koalaman#1749 from lvjp/simple-docker-build
      Include missing Semigroup import
      Hide <> from Writer to not conflict with Semigroup
      Update brew before building on macOS due to incompatible Ruby
      Merge pull request koalaman#1735 from gabrielelana/quoted-heredoc
      Merge pull request koalaman#1734 from gabrielelana/braced-regular-for
      Merge pull request koalaman#1716 from ryantig/ryantig-patch-1
      Merge pull request koalaman#1728 from mgttlinger/patch-1
      Support Cabal 3. Man page no longer autobuilds.
      Explicitly add 'mappend' for old GHC versions
      Revert docker image to 18.04 since ld fails on later versions
      Try to search for binary on macOS/Cabal3

Will Bradley (5):
      Allow local in sh scripts even though it isn't officially part of POSIX shell.
      CHROMIUM: stop complaining about 'which' in portage build scripts
      CHROMIUM: portage compatibility: squelch warnings for EBUILD_PHASE_FUNC
      CHROMIUM: increase depth of categorization for Portage files
      CHROMIUM: Implement check for illegal stable KEYWORDS in -9999 cros-workon Ebuilds.

gabriele.lana (2):
      Parse regular `for` with body in curly braces
      Support for heredoc quoted token like `'"FOO"`

ryantig (1):
      Update README.md

 .compile_binaries                     |  23 +-
 .travis.yml                           |   2 +-
 CHANGELOG.md                          |  11 +
 COMMIT-QUEUE.ini                      |  12 +
 Dockerfile                            |   4 +-
 OWNERS                                |   3 +
 README.md                             |   7 +-
 Setup.hs                              |  36 --
 ShellCheck.cabal                      |  12 +-
 manpage                               |   4 +
 shellcheck.1.md                       |   5 +-
 src/ShellCheck/AST.hs                 |   2 +-
 src/ShellCheck/Analytics.hs           | 222 ++++++++++--
 src/ShellCheck/AnalyzerLib.hs         |  38 ++-
 src/ShellCheck/Checker.hs             |   7 +-
 src/ShellCheck/Checks/Commands.hs     |  37 +-
 src/ShellCheck/Checks/ShellSupport.hs |   4 +-
 src/ShellCheck/Data.hs                | 625 +++++++++++++++++++++++++++++++++-
 src/ShellCheck/Formatter/Diff.hs      |  21 +-
 src/ShellCheck/Interface.hs           |  24 +-
 src/ShellCheck/Parser.hs              |  26 +-
 21 files changed, 978 insertions(+), 147 deletions(-)
 create mode 100644 COMMIT-QUEUE.ini
 create mode 100644 OWNERS
 delete mode 100644 Setup.hs
 create mode 100755 manpage

BUG=chromium:1024635
TEST=stack test

Change-Id: I3eb00707cb2f2b4e967d4db430a7e8ca2e41626e
  • Loading branch information
yetamrra committed Nov 27, 2019
2 parents 5587a8a + 5c7d812 commit 5364c42
Show file tree
Hide file tree
Showing 15 changed files with 203 additions and 111 deletions.
23 changes: 10 additions & 13 deletions .compile_binaries
@@ -1,9 +1,5 @@
#!/bin/bash

_cleanup(){
rm -rf dist shellcheck || true
}

build_linux() {
# Linux Docker image
name="$DOCKER_BASE"
Expand All @@ -27,10 +23,8 @@ build_linux() {
# Linux Alpine based Docker image
name="$DOCKER_BASE-alpine"
DOCKER_BUILDS="$DOCKER_BUILDS $name"
sed -e '/DELETE-MARKER/,$d' Dockerfile > Dockerfile.alpine
docker build -f Dockerfile.alpine -t "$name:current" .
docker build -f Dockerfile -t "$name:current" --target alpine .
docker run "$name:current" sh -c 'shellcheck --version'
_cleanup
}

build_aarch64() {
Expand All @@ -50,21 +44,20 @@ build_armv6hf() {
do
cp "shellcheck" "deploy/shellcheck-$tag.linux-armv6hf";
done
_cleanup
}

build_windows() {
# Windows .exe
docker run --user="$UID" -v "$PWD:/appdata" koalaman/winghc cuib
docker run -v "$PWD:/appdata" koalaman/winghc cuib
for tag in $TAGS
do
cp "dist/build/ShellCheck/shellcheck.exe" "deploy/shellcheck-$tag.exe";
done
_cleanup
}

build_osx() {
# Darwin x86_64 static executable
# Darwin x86_64 executable
brew update
brew install cabal-install pandoc gnu-tar
sudo ln -s /usr/local/bin/gsha512sum /usr/local/bin/sha512sum
sudo ln -s /usr/local/bin/gtar /usr/local/bin/tar
Expand All @@ -73,10 +66,14 @@ build_osx() {
cabal update
cabal install --dependencies-only
cabal build shellcheck

# Cabal 3 no longer has a predictable output path
path="$(find . -name 'shellcheck' -type f -perm +111)"
[[ -e "$path" ]]

for tag in $TAGS
do
cp "dist/build/shellcheck/shellcheck" "deploy/shellcheck-$tag.darwin-x86_64";
cp "$path" "deploy/shellcheck-$tag.darwin-x86_64";
done
_cleanup
}

2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -31,7 +31,7 @@ script:
- mkdir -p deploy
- source ./.compile_binaries
- ./striptests
- set -x; build_"$BUILD"; set +x;
- set -ex; build_"$BUILD"; set +x;
- ./.prepare_deploy

after_success: |
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,13 @@
## v0.7.1 - soon
### Fixed
- `-f diff` no longer claims that it found more issues when it didn't
- Known empty variables now correctly trigger SC2086

### Added
- SC2254: Suggest quoting expansions in case statements
- SC2255: Suggest using `$((..))` in `[ 2*3 -eq 6 ]`
- SC2256: Warn about translated strings that are known variables

## v0.7.0 - 2019-07-28
### Added
- Precompiled binaries for macOS and Linux aarch64
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Expand Up @@ -12,7 +12,7 @@ COPY ShellCheck.cabal ./
RUN cabal update && cabal install --dependencies-only --ghc-options="-optlo-Os -split-sections"

# Copy source and build it
COPY LICENSE Setup.hs shellcheck.hs ./
COPY LICENSE shellcheck.hs ./
COPY src src
RUN cabal build Paths_ShellCheck && \
ghc -optl-static -optl-pthread -isrc -idist/build/autogen --make shellcheck -split-sections -optc-Wl,--gc-sections -optlo-Os && \
Expand All @@ -22,7 +22,7 @@ RUN mkdir -p /out/bin && \
cp shellcheck /out/bin/

# Resulting Alpine image
FROM alpine:latest
FROM alpine:latest AS alpine
LABEL maintainer="Vidar Holen <vidar@vidarholen.net>"
COPY --from=build /out /

Expand Down
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -116,7 +116,7 @@ Services and platforms with third party plugins:

Most other services, including [GitLab](https://about.gitlab.com/), let you install
ShellCheck yourself, either through the system's package manager (see [Installing](#installing)),
or by downloading and unpacking a [binary release](#installing-the-shellcheck-binary).
or by downloading and unpacking a [binary release](#installing-a-pre-compiled-binary).

It's a good idea to manually install a specific ShellCheck version regardless. This avoids
any surprise build breaks when a new version with new warnings is published.
Expand Down Expand Up @@ -209,6 +209,11 @@ docker run --rm -v "$PWD:/mnt" koalaman/shellcheck:stable myscript

or use `koalaman/shellcheck-alpine` if you want a larger Alpine Linux based image to extend. It works exactly like a regular Alpine image, but has shellcheck preinstalled.

Using the [nix package manager](https://nixos.org/nix):
```sh
nix-env -iA nixpkgs.shellcheck
```

Alternatively, you can download pre-compiled binaries for the latest release here:

* [Linux, x86_64](https://storage.googleapis.com/shellcheck/shellcheck-stable.linux.x86_64.tar.xz) (statically linked)
Expand Down
36 changes: 0 additions & 36 deletions Setup.hs

This file was deleted.

12 changes: 3 additions & 9 deletions ShellCheck.cabal
Expand Up @@ -7,7 +7,7 @@ Category: Static Analysis
Author: Vidar Holen
Maintainer: vidar@vidarholen.net
Homepage: https://www.shellcheck.net/
Build-Type: Custom
Build-Type: Simple
Cabal-Version: >= 1.8
Bug-reports: https://github.com/koalaman/shellcheck/issues
Description:
Expand All @@ -26,19 +26,13 @@ Extra-Source-Files:
-- documentation
README.md
shellcheck.1.md
-- built with a cabal sdist hook
shellcheck.1
-- A script to build the man page using pandoc
manpage
-- convenience script for stripping tests
striptests
-- tests
test/shellcheck.hs

custom-setup
setup-depends:
base >= 4 && <5,
process >= 1.0 && <1.7,
Cabal >= 1.10 && <2.5

source-repository head
type: git
location: git://github.com/koalaman/shellcheck.git
Expand Down
4 changes: 4 additions & 0 deletions manpage
@@ -0,0 +1,4 @@
#!/bin/sh
echo >&2 "Generating man page using pandoc"
pandoc -s -f markdown-smart -t man shellcheck.1.md -o shellcheck.1 || exit
echo >&2 "Done. You can read it with: man ./shellcheck.1"

0 comments on commit 5364c42

Please sign in to comment.