<commit_before># ------------------
# TERRAFORM-MAKEFILE
# v0.12.19
# ------------------
#
# Terraform makefile is a helper to run terraform commands
# on separate providers
#
# Copyright (C) 2017  Paul(r)B.r
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
# This Makefile is maintained on Github.com.
# Please contribute upstream any changes by opening pull requests:
# https://github.com/paulRbr/terraform-makefile/pull/new/master
# Thanks! - Paul(rbr)

##
# TERRAFORM INSTALL
##
version  ?= "0.12.19"
os       ?= $(shell uname|tr A-Z a-z)
ifeq ($(shell uname -m),x86_64)
  arch   ?= "amd64"
endif
ifeq ($(shell uname -m),i686)
  arch   ?= "386"
endif
ifeq ($(shell uname -m),aarch64)
  arch   ?= "arm"
endif

##
# INTERNAL VARIABLES
##
# Read all subsquent tasks as arguments of the first task
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(args) $(RUN_ARGS):;@:)
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
landscape   := $(shell command -v landscape 2> /dev/null)
terraform   := $(shell command -v terraform 2> /dev/null)
debug       :=

##
# MAKEFILE ARGUMENTS
##
ifndef terraform
  install ?= "true"
endif
ifeq ("$(upgrade)", "true")
  install ?= "true"
endif

##
# TASKS
##
.PHONY: install
install: ## Install terraform and dependencies
ifeq ($(install),"true")
	@wget -O /usr/bin/terraform.zip https://releases.hashicorp.com/terraform/$(version)/terraform_$(version)_$(os)_$(arch).zip
	@unzip -d /usr/bin /usr/bin/terraform.zip && rm /usr/bin/terraform.zip
endif
	@terraform --version
	@bash $(dir $(mkfile_path))/terraform.sh init $(args)

.PHONY: fmt
fmt:
	@terraform fmt $(args) $(RUN_ARGS)
.PHONY: lint
lint: ## Rewrites config to canonical format
	@terraform fmt -diff=true -check $(args) $(RUN_ARGS)

.PHONY: validate
validate: ## Basic syntax check
	@bash $(dir $(mkfile_path))/terraform.sh validate $(args) $(RUN_ARGS)

.PHONY: show
show: ## List infra resources
	@bash $(dir $(mkfile_path))/terraform.sh show $(args) $(RUN_ARGS)

.PHONY: refresh
refresh: ## Refresh infra resources
	@bash $(dir $(mkfile_path))/terraform.sh refresh $(args) $(RUN_ARGS)

.PHONY: console
console: ## Console infra resources
	@bash $(dir $(mkfile_path))/terraform.sh console $(args) $(RUN_ARGS)
<commit_msg>fix: fmt and lint commands were not executed in the env's context<commit_after># ------------------
# TERRAFORM-MAKEFILE
# v0.12.19
# ------------------
#
# Terraform makefile is a helper to run terraform commands
# on separate providers
#
# Copyright (C) 2017  Paul(r)B.r
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
# This Makefile is maintained on Github.com.
# Please contribute upstream any changes by opening pull requests:
# https://github.com/paulRbr/terraform-makefile/pull/new/master
# Thanks! - Paul(rbr)

##
# TERRAFORM INSTALL
##
version  ?= "0.12.19"
os       ?= $(shell uname|tr A-Z a-z)
ifeq ($(shell uname -m),x86_64)
  arch   ?= "amd64"
endif
ifeq ($(shell uname -m),i686)
  arch   ?= "386"
endif
ifeq ($(shell uname -m),aarch64)
  arch   ?= "arm"
endif

##
# INTERNAL VARIABLES
##
# Read all subsquent tasks as arguments of the first task
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(args) $(RUN_ARGS):;@:)
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
landscape   := $(shell command -v landscape 2> /dev/null)
terraform   := $(shell command -v terraform 2> /dev/null)
debug       :=

##
# MAKEFILE ARGUMENTS
##
ifndef terraform
  install ?= "true"
endif
ifeq ("$(upgrade)", "true")
  install ?= "true"
endif

##
# TASKS
##
.PHONY: install
install: ## Install terraform and dependencies
ifeq ($(install),"true")
	@wget -O /usr/bin/terraform.zip https://releases.hashicorp.com/terraform/$(version)/terraform_$(version)_$(os)_$(arch).zip
	@unzip -d /usr/bin /usr/bin/terraform.zip && rm /usr/bin/terraform.zip
endif
	@terraform --version
	@bash $(dir $(mkfile_path))/terraform.sh init $(args)

.PHONY: fmt
fmt: ## Rewrites config to canonical format
	@bash $(dir $(mkfile_path))/terraform.sh fmt $(args)

.PHONY: lint
lint: ## Lint the HCL code
	@bash $(dir $(mkfile_path))/terraform.sh fmt -diff=true -check $(args) $(RUN_ARGS)

.PHONY: validate
validate: ## Basic syntax check
	@bash $(dir $(mkfile_path))/terraform.sh validate $(args) $(RUN_ARGS)

.PHONY: show
show: ## List infra resources
	@bash $(dir $(mkfile_path))/terraform.sh show $(args) $(RUN_ARGS)

.PHONY: refresh
refresh: ## Refresh infra resources
	@bash $(dir $(mkfile_path))/terraform.sh refresh $(args) $(RUN_ARGS)

.PHONY: console
console: ## Console infra resources
	@bash $(dir $(mkfile_path))/terraform.sh console $(args) $(RUN_ARGS)

{'fraction_non_alphanumeric': 0.15164496230294722, 'fraction_numerical': 0.010966415352981495, 'mean_word_length': 4.14273127753304, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2661997', 'n_tokens_mistral': 2039, 'n_tokens_neox': 1969, 'n_words': 652}