The preferred method is installation via Homebrew.
brew install salsadigitalauorg/shipshape/shipshape
curl -L -o shipshape https://github.com/salsadigitalauorg/shipshape/releases/latest/download/shipshape-$(uname -s)-$(uname -m)
chmod +x shipshape
mv shipshape /usr/local/bin/shipshape
Run directly from a docker image:
docker run --rm ghcr.io/salsadigitalauorg/shipshape:latest shipshape --version
Or add to your docker image:
COPY --from=ghcr.io/salsadigitalauorg/shipshape:latest /usr/local/bin/shipshape /usr/local/bin/shipshape
Create a config file. Can be as simple as:
# shipshape.yml
checks:
file:
- name: Illegal files
path: web
disallowed-pattern: '^(adminer|phpmyadmin|bigdump)?\.php$'
See the configuration documentation for more information.
$ shipshape -h
Shipshape
Run checks quickly on your project.
Usage:
shipshape [dir]
Flags:
--dump-config Dump the final config - useful to make sure multiple config files are being merged as expected
-e, --error-code Exit with error code if a failure is detected (env: SHIPSHAPE_ERROR_ON_FAILURE)
-d, --exclude-db Exclude checks requiring a database; overrides any db checks specified by '--types'
-f, --file strings Path to the file containing the checks. Can be specified as comma-separated single argument or using --types multiple times (default [shipshape.yml])
-h, --help Displays usage information
--list-checks List available checks
-o, --output string Output format [json|junit|simple|table] (env: SHIPSHAPE_OUTPUT_FORMAT) (default "simple")
-t, --types strings List of checks to run; default is empty, which will run all checks. Can be specified as comma-separated single argument or using --types multiple times
-v, --version Displays the application version
Check out our documentation at https://salsadigitalauorg.github.io/shipshape/. Keep in mind that this is still a work in progress, so please go easy.
git clone [email protected]:salsadigitalauorg/shipshape.git && cd shipshape
go generate ./...
go build -ldflags="-s -w" -o build/shipshape .
go run . -h
go generate ./...
go test -v ./... -coverprofile=build/coverage.out
View coverage results:
go tool cover -html=build/coverage.out
cd docs
npm install
npm run dev