Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
# Review settings
REPO = https://github.com/GlobalNOC/OESS.git
VERSION ?= master
SRC_DIR = src
# Use docker buildkit (it just makes things better)
export DOCKER_BUILDKIT=1
# Build perlcritic image
.PHONY: build
build:
docker build . -t oess-review:latest
# Run perlcritic
.PHONY: perlcritic
PC_ARGS ?= --no-color
perlcritic: $(SRC_DIR)
cd $(SRC_DIR); git checkout $(VERSION)
docker run -it \
-v $(PWD)/$(SRC_DIR):/src \
--rm oess-review:latest perlcritic --statistics $(PC_ARGS) \
src
# Rudimentary age of a file - when was the last-commit stamp for any specific file
.PHONY: code-age
code-age: $(SRC_DIR)
@cd $(SRC_DIR); git checkout $(VERSION)
@cd $(SRC_DIR); git ls-files | while read file; do \
git --no-pager log -n 1 --date=iso \
--pretty="%ad: %h: $$file" -- $$file; \
done
# Open a shell inside perlcritic
.PHONY: shell
shell: $(SRC_DIR)
cd $(SRC_DIR); git checkout $(VERSION)
docker run -it \
-v $(PWD)/$(SRC_DIR):/src \
--rm oess-review:latest \
bash
# Get a copy of the OESS source code
$(SRC_DIR):
git clone -b $(VERSION) $(REPO) $(SRC_DIR)