A library with Make targets, Ansible playbooks, Jinja templates (and more) designed to boost common software development tasks and enhance governance.
A library with Make targets, Ansible playbooks, Jinja templates (and more) designed to boost common software development tasks and enhance governance.
Installing AWS Code Habits |
AWS Code Habits was developed to be used as a git submodule.
On a terminal, on your project's root directory, execute one of the following commands:
git submodule add --name habits -b main https://github.com/awslabs/aws-code-habits.git habits
This will clone AWS Code Habits on a folder named habits
and track against the main
branch.
Now, you will need to create, or add to your existing, Makefile
.
export WORKSPACE=$(shell pwd)
export HABITS = $(WORKSPACE)/habits
include $(WORKSPACE)/tools.env # pin the version of your tools
include $(HABITS)/lib/make/*/*.mk
include $(HABITS)/lib/make/*.mk
Remember, next time you need to clone your repository, you will need to include --recurse-submodules
parameters.
git clone --recurse-submodules ...
If you already cloned the project and forgot
--recurse-submodules
, you can combine thegit submodule init
andgit submodule update
steps by runninggit submodule update --init
. To also initialize, fetch and checkout any nested submodules, you can use the foolproofgit submodule update --init --recursive
. - Git Tools Submodules
Check the scripts directory, if you want to automate the initialization and installation of AWS Code Habits.`
A list of things you need, or how to install them.
At this stage, we are only supporting Linux (Ubuntu) environments (which can be obtained via WSL (Windows) or DevContainers (Mac/Linux/Windows))
make [tab][tab]
make help
For more information about each Make targets available.
Below you can learn
make pre-commit/init
To run all pre-commit
rules in all files, simply run:
make pre-commit/run
make doc/init
This will create a folder named doc/
in the root directory of your project and create a file named habits.yaml
inside of it.
doc/habits.yaml
accordingly and execute:make doc/build
README.md
will be rendered.You can use Habits to meet your needs, in your Makefile
you can add the following to ensure code and documentation hygiene:
.PHONY: hygiene
hygiene: doc/build pre-commit/run
Another example, if you want to perform several tasks with AWS CloudFormation
:
.PHONY: hygiene
hygiene: aws/cloudformation/hygiene
.PHONY: plan
plan: aws/cloudformation/create-change-set
.PHONY: discard
discard: aws/cloudformation/delete-change-set
.PHONY: apply
apply: aws/cloudformation/execute-change-set
To perform habits checks:
make habits/check
This project is licensed under the MIT-0 License. See the LICENSE file.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.