-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify literalEquals #1824
Merged
Merged
Simplify literalEquals #1824
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TIL! |
Kangie
pushed a commit
to Kangie/shellcheck
that referenced
this pull request
Feb 27, 2023
Merge of upstream through 5cf2c00 Conflicts: src/ShellCheck/Analytics.hs Manual changes: Minor conflicts in variable lists for portage Changelog: ---------------------------------------------------------------- Artur Klauser (4): Add multi-architecture Docker image build Don't try to deploy docker images on PR runs Run "deploy" step only for "Build" stages Use shellcheck on yourself Austin English (1): src/ShellCheck/Analytics.hs: suggest using a shell directive for SC2148 Benjamin Gordon (1): Merge 'upstream/master' into chromeos-0.7 Joseph C. Sible (82): Simplify literalEquals Use findM instead of filterM Use the Identity monad to avoid unnecessary uses of fromJust Remove more unnecessary uses of fromJust Switch getLiteralStringExt to Identity where it can never be Nothing Add getLiteralStringDef and simplify with it Replace mapMaybe and concatMap with list comprehensions Use mapM instead of implementing a slower version of it Use find instead of take 1 and filter Use mapM_ and sequence_ instead of reimplementing them Simplify check and checkTranslatedStringVariable Get rid of potentially Use head instead of reimplementing it Use void instead of do and return () Simplify matchToken Simplify <> for SpaceStatus Inline an uncurry Avoid unnecessary use of when and unless Simplify findFunction Use Map.! instead of reimplementing it Simplify a double negative Do toLower earlier Remove unnecessary fromMaybes Avoid a zip that breaks fusion Use forM_ instead of reimplementing it Use isNothing instead of reimplementing it Use Map.member instead of isJust and Map.lookup Simplify determineShell Remove unnecessary uses of head Use isJust instead of reimplementing it Simplify shellFromFilename Simplify mockedSystemInterface Remove a partial pattern match equivalent to fromJust from checkFindNameGlob Optimize patterns in checkFindNameGlob Use headOrDefault instead of fromMaybe and listToMaybe Simplify checkForInQuoted Simplify checkWhileReadPitfalls Mark that base >= 4.8.0.0 is required Fix koalaman#1892: Use pattern synonyms to clean up AST Simplify nameExpansion Use force instead of reimplementing it Remove unnecessary Maybe from isQuoteFreeElement Implement findFirst in terms of foldr Use execState instead of reimplementing it Simplify causesSubshell Use a list comprehension instead of a concatMap with extra lists Remove unnecessary maybeToList Remove unnecessary as-patterns Remove an unnecessary operator section Simplify isArrayFlag Use head instead of (!! 0) Simplify dropPrefix Simplify getSpecial Don't bother with asks if you're just immediately binding the result anyway Implement supportsArrays with pattern-matching Simplify process Simplify getCommandNameAndToken Simplify getAssociativeArrays Remove unnecessary monadicity from wordToPseudoGlob Remove unnecessary cases from wordToPseudoGlob Only perform the comparisons once Use foldr in checkFindNameGlob Use pattern matching instead of snd Use a guard instead of unless Prefer pattern matching in undirected Simplify checkArg Use MultiWayIf instead of case-matching on () Simplify checkSetAssignment Simplify warnRedundant Make skipRepeating lazier and faster Make it slightly lazier still (and more clear) Write getLiteralArgs with foldr and without fromMaybe or monads Remove unnecessary fromMaybe and when from bashism Use fromRight instead of reimplementing it Avoid some awkward parentheses with forM_ Simplify thenSkip, and use in another location Simplify checkVariableBraces Combine bracedString into getSingleUnmodifiedVariable Get rid of bracedString everywhere it's easy to Move bracedString to be local to its last use site Clean up and optimize getSuspiciousRegexWildcard Revert "Use fromRight instead of reimplementing it" Marcin Szydelski (1): SC2016: disable for mumps -run %XCMD and LOOP%XCMD Vidar Holen (59): Merge pull request koalaman#1828 from josephcsible/cleanups Merge pull request koalaman#1827 from josephcsible/nofromjust2 Merge pull request koalaman#1826 from josephcsible/nofromjust Merge pull request koalaman#1825 from josephcsible/nofilterm Merge pull request koalaman#1824 from josephcsible/patch-1 Merge pull request koalaman#1802 from szydell/master Merge pull request koalaman#1785 from ArturKlauser/multi-arch-docker Merge pull request koalaman#1831 from josephcsible/checkfindnameglob Don't try to deploy on PRs Rename 'Test' stage Parse keywords with case sensitivity (fixes koalaman#1809) Bump SC1102/SC1105 about ambiguous `$((` to Error (fixes koalaman#1836) Remove unused instance Ord Replacement (fixes koalaman#1829) Inspect 'alias' commands for referenced variables (Fixes koalaman#1832) SC2257: Warn when changing arithmetic variables in redirections Upload to assets to GitHub Merge pull request koalaman#1862 from austin987/sc2148-shell-directive Fix TravisCI condition Refer to GitHub rather than GCS for release builds Make SC2095 (ssh in while read loops) more robust and suggest fixes Merge pull request koalaman#1865 from josephcsible/patch-1 Improve detection of for loops with single values Try to make TravisCI not fail on deployment of Docker stage Include shebang in AST traversal (fixes koalaman#1858) Stop deploying artifacts to GCS Update distro tests to support newer Cabal Merge pull request koalaman#1893 from josephcsible/pattern-synonyms Merge pull request koalaman#1872 from josephcsible/checkforinquoted Merge pull request koalaman#1873 from josephcsible/checkwhilereadpitfalls Merge pull request koalaman#1880 from josephcsible/patch-1 Merge pull request koalaman#1885 from ArturKlauser/travis-pr-fix Merge pull request koalaman#1897 from ArturKlauser/use-shellcheck-on-yourself Merge pull request koalaman#1896 from ArturKlauser/travis-deploy-stage-fix Merge pull request koalaman#1876 from fork-graveyard/master Don't warn about [ 0 -ne $FOO ] || [ 0 -ne $BAR ] (fixes koalaman#1891) Stable version v0.7.1 Update Changelog with new version Filter GitHub uploads by tag Disable SC2257 about > $((i=42)) for Dash Merge pull request koalaman#1898 from josephcsible/nameexpansion Merge pull request koalaman#1900 from josephcsible/analyzerlib Merge pull request koalaman#1902 from josephcsible/astlib Merge pull request koalaman#1904 from josephcsible/commands Merge pull request koalaman#1903 from josephcsible/fixer Merge pull request koalaman#1901 from josephcsible/bracedstring Merge pull request koalaman#1905 from josephcsible/skiprepeating Merge pull request koalaman#1906 from josephcsible/shellsupport Merge pull request koalaman#1907 from josephcsible/formatters Merge pull request koalaman#1917 from josephcsible/thenskip Merge pull request koalaman#1918 from josephcsible/getsuspiciousregexwildcard Merge pull request koalaman#1925 from josephcsible/nofromright Merge pull request koalaman#1927 from scop/sc-prefix Merge pull request koalaman#1926 from scop/spelling Warn about duplicate uses of stdin/out/err Improve SC2259/60/61 messages Allow disabling SC1072/SC1073 with annotations (fixes koalaman#1931) Merge pull request koalaman#1950 from geeseven/aur-shellcheck-bin Count $# as an argument reference in SC2120 Warn about defining and using an alias in a single command (fixes koalaman#1807) Ville Skyttä (2): Spelling fixes Use SC prefix for disable= in man page geeseven (1): update dependency free AUR package girst (1): recognize `: ${parameter=word}` as assignment .compile_binaries | 6 - .github_deploy | 58 +++ .multi_arch_docker | 113 +++++ .travis.yml | 34 +- CHANGELOG.md | 20 +- Dockerfile | 7 - Dockerfile.multi-arch | 26 ++ README.md | 17 +- ShellCheck.cabal | 6 +- nextnumber | 2 +- shellcheck.1.md | 6 +- shellcheck.hs | 12 +- src/ShellCheck/AST.hs | 542 ++++++++++-------------- src/ShellCheck/ASTLib.hs | 83 ++-- src/ShellCheck/Analytics.hs | 748 +++++++++++++++++++++++----------- src/ShellCheck/AnalyzerLib.hs | 185 ++++----- src/ShellCheck/Checker.hs | 18 +- src/ShellCheck/Checks/Commands.hs | 162 ++++---- src/ShellCheck/Checks/ShellSupport.hs | 44 +- src/ShellCheck/Fixer.hs | 16 +- src/ShellCheck/Formatter/TTY.hs | 5 +- src/ShellCheck/Interface.hs | 11 +- src/ShellCheck/Parser.hs | 55 ++- test/buildtest | 23 +- test/check_release | 3 +- test/distrotest | 22 +- 26 files changed, 1286 insertions(+), 938 deletions(-) create mode 100755 .github_deploy create mode 100755 .multi_arch_docker create mode 100644 Dockerfile.multi-arch BUG=chromium:1086928 TEST=stack test Cq-Depend: chromium:2233790 Change-Id: Icaa54e0a17181685f1f8234a9ab811bc24229338
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.