Code Monkey home page Code Monkey logo

cremindes / whalelint Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 2.0 1.01 MB

Dockerfile linter written in Go. It provides static analysis for Dockerfiles, identifying common mistakes and promotes best practices.

License: MIT License

Go 89.70% TypeScript 3.66% JavaScript 0.51% Kotlin 5.76% HTML 0.03% Dockerfile 0.26% Shell 0.07%
docker dockerfile-linter dockerfile docker-image docker-container dockerhub linter vscode-extension jetbrains-plugin container

whalelint's Introduction

WhaleLint

made-with-Go

Disclaimer: this has started out as a pet-project while learning Golang.

Dockerfile linter written in Go.

It provides static analysis for Dockerfiles, identifying common mistakes and promotes best practices.

Sample output

Rules

Each Dockerfile AST element has a corresponding set of rules. Click on the picture for details.

Development

Roadmap

Feature Status
Extendable ruleset Done
CLI Done
Configurable Output Done
- JSON Done
- Colored Summary Done
Docker image Done
Rule pass NotYetStarted
- Per line NotYetStarted
- Config file NotYetStarted
Config file NotYetStarted
- Rule profiles NotYetStarted
IDE plugins/extensions InProgress
- VSCode PreviewRelease
- JetBrains PreviewRelease

Design Decisions

A collection of documents describing the thought process behind selected design decisions. Link >

Contribution Guide

Link > TODO

Docker Image

Docker imaage version DockerHub Downloads Docker image size

docker pull cremindes/whalelint:[tag]
docker run --rm -v $(pwd)/Dockerfile:/Dockerfile cremindes/whalelint:[tag] Dockerfile

Plugins

JetBrains

Version Downloads

*Note: make sure, to also install the Docker plugin in case it's not bundled with the IDE.

VSCode

Version Installs

Alternatives

Alternatives

whalelint's People

Contributors

cremindes avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

whalelint's Issues

Support Arg variable resolution.

Arg variable resolution is not necessarily straightforward, because:

  • Not all fields are exported in BuildKit's representation, so raw lines are not editable at the moment, which is not a showstopper, but needs a bit of a thinking.
  • Back and forth mapping is needed for proper location handling.
  • Args might be mixed with "inline" defined env vars in RUN commands.

whalelint background process 100% CPU

IntelliJ freezes with the whalelint background process consuming 100% CPU.
Are there some debug options for understanding what's going wrong?

Environment

Ubuntu 22.04.3 LTS
IntelliJ IDEA 2023.2.4 (Community Edition)
WhaleLint plugin version: 0.0.7
.local/share/JetBrains/IdeaIC2023.2/whalelint/bin/whalelint version: v0.0.6

JetBrains plugin v0.0.7: crash on Win10

Expected behavior

Plugin works normal.

Observed behavior

Plugin crash on enabling.

Stacktrace Error running inspection:

java.io.IOException: Cannot run program "C:\Users\username\AppData\Roaming\JetBrains\IdeaIC2023.2\plugins\whalelint\bin\whalelint": CreateProcess error=193, %1 is not a valid Win32 application
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at java.base/java.lang.Runtime.exec(Runtime.java:594)
at java.base/java.lang.Runtime.exec(Runtime.java:453)
at whalelint.WhaleLintExternalAnnotator.doAnnotate(WhaleLintExternalAnnotator.kt:64)
at whalelint.WhaleLintExternalAnnotator.doAnnotate(WhaleLintExternalAnnotator.kt:31)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:207)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:201)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$0(ExternalToolPass.java:164)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass.runChangeAware(ExternalToolPass.java:266)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$2(ExternalToolPass.java:164)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:360)
at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:162)
at com.intellij.util.ui.update.Update.runUpdate(Update.java:114)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:348)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:338)
at com.intellij.util.ui.update.MergingUpdateQueue.doFlush(MergingUpdateQueue.java:295)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:277)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:254)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:373)
at com.intellij.util.Alarm$Request.run(Alarm.java:360)
at com.intellij.util.concurrency.Propagation.contextAwareCallable$lambda$2(propagation.kt:328)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:249)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:31)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:227)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:215)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.(ProcessImpl.java:499)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:158)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
... 43 more

Environment

  • Windows 10 22H2 19045.3570 x64
  • IntelliJ IDEA Community 2023.2.4 Build #IC-232.10203.10, built on October 25, 2023
  • WhaleLint 0.0.7

apt-get update complains about not being passed -y

Thanks for the great work Tamas!
apt-get update && apt-get install --no-install-recommends -y ...
Complains about -y not being passed to update, also the install has still a warning to add --no-install-recommends, although being fixed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.