swellaby / azdo-shellcheck Goto Github PK
View Code? Open in Web Editor NEWShellCheck extension for Azure DevOps
License: MIT License
ShellCheck extension for Azure DevOps
License: MIT License
ShellCheck does not natively support the JUnit XML format.
Seems the best way to go about adding JUnit support (per ShellCheck docs) is to utilize the checkstyle xml format (i.e. -f checkstyle
) and then use an xslt to transform that to JUnit xml format.
Support version specification on Mac-based agents (currently only stable can be installed via HomeBrew)
Starting with v0.7.0, the ShellCheck releases include a pre-built binary for Mac, so our task should correspondingly enable that version selection for users
Should allow users to include the additional options supported by ShellCheck, but fall back to default ShellCheck behavior otherwise
-x
- follow sourced files-f
output format (json, xml, etc.)-d
dialect (sh/bash/ksh/etc.)-e
exclude rulesEdit 1 - Added -e
This issue provides visibility into Renovate updates and their statuses. Learn more
These updates are pending. To force PRs open, click the checkbox below.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
Support optional brace expansion on the targetFiles
input of the ShellCheck run task
The Azure Pipelines Task Lib supports pattern matching for files from input parameters, but brace expansion is disabled by default due to challenges with escaping on Windows.
Making brace expansion available to users (via a new input option) would allow for leveraging more powerful globs/patterns for specifying target files to run ShellCheck against
The Run Task trhows an error saying that shellcheck was installed from the wrong location.
Starting: Install ShellCheck
==============================================================================
Task : Install ShellCheck
Description : Installs Specified ShellCheck Version
Version : 0.1.16
Author : Swellaby
Help : [More Information](https://github.com/swellaby/azdo-shellcheck)
==============================================================================
Downloading: https://shellcheck.storage.googleapis.com/shellcheck-latest.linux.x86_64.tar.xz
/bin/tar xC /home/vsts/work/_temp/shellcheck-latest -f /home/vsts/work/_temp/a73463fe-8e7c-4efd-a92a-60ed4f18c8d4
Prepending PATH environment variable with directory: /home/vsts/work/_temp/shellcheck-latest/shellcheck-latest
Finishing: Install ShellCheck
Starting: Run ShellCheck
==============================================================================
Task : ShellCheck
Description : Run ShellCheck
Version : 0.3.16
Author : Swellaby
Help : [More Information](https://github.com/swellaby/azdo-shellcheck)
==============================================================================
/home/vsts/work/_temp/shellcheck-latest/shellcheck-latest/shellcheck myscripts.sh
You are downloading ShellCheck from the wrong URL!
Please update to the latest one:
https://github.com/koalaman/shellcheck/releases/download/latest/shellcheck-latest.linux.x86_64.tar.xz
For more information, see:
https://github.com/koalaman/shellcheck/issues/1871
##[error]ShellCheck scan failed! Check the logs for violation details.
Finishing: Run ShellCheck
-->
I'm increasingly feeling that we should deprecate this extension, or at least officially mark it is in maintenance-only mode and close the remaining issues (it's been here functionally for at least a year).
The extension provides two pipeline tasks that respectively deliver two capabilities: install a specified version of ShellCheck, run ShellCheck
Thoughts anyone?
In the intervening years since we originally released the extension, ShellCheck has been incorporated into the set of pre-installed software on the Linux agents/runners, so I think that largely obviates our install task for those able to use the Microsoft-hosted pools. Admittedly, it's not on the Mac nor Windows agents, nor does that cover self-hosted agents. However, ShellCheck can be easily grabbed on Mac and Windows using their respective package managers, and the AFAICT the main Linux package managers have relatively up to date versions of ShellCheck these days (wasn't the case back in the day).
Additionally, the install task could be fiddly. I know I've had trouble trying to use it at the day job with pipelines running on agents behind a proxy, to the point that I'd switched our own such pipelines to just use scripts ๐ฑ @beverts312 correct me if I'm wrong, but I think you also just downloaded/used and ran ShellCheck natively in your pipelines as well right?
The only real utility I see for the task that runs/executes ShellCheck is centered around the recursive file behavior. However, with the big shift to pipeline-as-code and the pending/inevitable decom of the UX/Visual Designer based pipelines it is much more common for devs to be working with their pipelines as code and more easily able to plug scripts in, and the benefits the custom task provided with buttons/navigators in the UX is going away.
It's not that hard to extend the script to run ShellCheck recursively in the Unix like/based environments, so I feel like the recursive behavior benefit largely boils down to Windows, and I just can't see there being a significant population of folks with valid use cases for massive ShellCheck use in a strictly Windows environment ๐
Include Installer support for aarch64 architecture
Starting with v0.7.0 the pre-compiled binaries for linux includes a target for aarch64, but the Installer task will currently fail on any arch other than arm and x86_64. We should support any architecture that has a corresponding pre-built binary
Add support for the the severity option (https://github.com/koalaman/shellcheck/blob/master/shellcheck.1.md#options)
Makes this option available for users so they can have greater control over the scan, and which level of severity will cause the scan (and thus the task) to fail
happy 2021
Add v0.7.0 to to the download task
It's the newest released version, but we only go up to 0.6.0 currently (plus latest
and stable
)
I feel like it would be good to include an icon with the task. The VS Code Extension for ShellCheck didn't add one, but for Azure Pipelines tasks it bothers me when there's no icon/default icon.
The favicon used on the ShellCheck site looks solid to me, although would probably need to double check on licensing/permissions/attribution/etc. https://www.shellcheck.net/favicon.ico
@beverts312 and/or @traviskosarek - thoughts or preferences?
The functional tests are failing, with a 400 http error on the API calls to Azure DevOps
Install task is throwing an error due to missing deps (presumably a bundling/packaging issue)
## Log Output
##[section]Starting: Install ShellCheck
==============================================================================
Task : Install ShellCheck
Description : Installs Specified ShellCheck Version
Version : 0.0.17
Author : Swellaby
Help : [More Information](https://github.com/swellaby/azdo-shellcheck)
==============================================================================
module.js:471
throw err;
^
Error: Cannot find module 'semver'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/vsts/work/_tasks/install-shellcheck_3f74db91-b37c-4602-bb92-2658c6d136f2/0.0.17/node_modules/azure-pipelines-task-lib/internal.js:10:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
##[error]Exit code 1 returned from process: file name '/home/vsts/agents/2.148.2/externals/node/bin/node', arguments '"/home/vsts/work/_tasks/install-shellcheck_3f74db91-b37c-4602-bb92-2658c6d136f2/0.0.17/runner.js"'.
##[section]Finishing: Install ShellCheck
Install task failing with unauthorized error on self-hosted agent behind a proxy
Currently the run task will auto-install ShellCheck if the bin cannot be found.
We should extract that into a separate tool installer task, which would give users more control over install behavior (including version selection)
Originally, I viewed this as more like a "nice to have" in my opinion vs. a "must-have for 1.x release", however, with the existing auto-install behavior the hosted agents are essentially caching shellcheck once installed which removes the users ability to specify version.
CC @beverts312
Leverage some of our newer templates
Our Azure Pipelines templates now has support for Node steps/jobs (refs swellaby/azure-pipelines-templates#17) let's switch the PR pipeline's to use those before setting up the CI pipeline
Set up GH Templates
Auto-install ShellCheck on supported platforms/architectures if it the executable is not already available
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.