https://github.com/awslabs/aws-code-habits
A library with Make targets, Ansible playbooks, Jinja templates (and more) designed to boost common software development tasks and enhance governance.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.1%) to scientific vocabulary
Keywords
Repository
A library with Make targets, Ansible playbooks, Jinja templates (and more) designed to boost common software development tasks and enhance governance.
Basic Info
Statistics
- Stars: 84
- Watchers: 5
- Forks: 12
- Open Issues: 0
- Releases: 6
Topics
Metadata Files
README.md

AWS Code Habits
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 |
Table of Contents
Getting Started
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:
bash
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.
```bash 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.
bash
git clone --recurse-submodules ...
If you already cloned the project and forgot
--recurse-submodules, you can combine thegit submodule initandgit submodule updatesteps 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.`
Prerequisites
A list of things you need, or how to install them.
AWS Code Habits now supports multiple platforms including Linux, macOS, and Windows (with some limitations). Many Makefiles include cross-platform detection and appropriate installation methods.
- Python 3 - Whether you're new to programming or an experienced developer, it's easy to learn and use Python.
- Pip - pip is the package installer for Python.
- GNU Make - GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files.
Usage
bash
make [tab][tab]
bash
make help
For more information about each Make targets available.
Each technology-specific Makefile includes its own help target. For example:
bash
make terraform/help
make nodejs/help
make python/help
make go/help
make gitignore/help
How-Tos
Below you can learn
How to initialize pre-commit config
bash
make pre-commit/init
To run all pre-commit rules in all files, simply run:
bash
make pre-commit/run
How to maintain documentation
- First initialize all documentation files:
bash 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.
- Modify the contents of
doc/habits.yamlaccordingly and execute:
make doc/build
README.mdwill be rendered.
How to expand Habits commands
You can use Habits to meet your needs, in your Makefile you can add the following to ensure code and documentation hygiene:
bash
.PHONY: hygiene
hygiene: doc/build pre-commit/run
Another example, if you want to perform several tasks with AWS CloudFormation:
```bash
.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 ```
How to use technology-specific Makefiles
AWS Code Habits includes several technology-specific Makefiles that provide targets for common development tasks:
Terraform
```bash
Install Terraform
make terraform/install
Initialize Terraform
make terraform/init
Plan changes
make terraform/plan
Apply changes
make terraform/apply
Manage workspaces
make terraform/workspace/list make terraform/workspace/new WORKSPACE_NAME=dev ```
AWS CDK
```bash
Install AWS CDK
make aws/cdk/install
Bootstrap CDK environment
make aws/cdk/bootstrap
Deploy CDK stack
make aws/cdk/deploy
Synthesize CloudFormation template
make aws/cdk/synth ```
Python
```bash
Install Python
make python/install
Initialize virtual environment
make python/virtualenv/init
Set up Poetry
make python/poetry/install make python/poetry/init
Run tests
make python/test ```
Node.js
```bash
Install Node.js
make nodejs/install
Initialize projects
make nodejs/init/express make nodejs/init/react make nodejs/init/vue
Package management
make nodejs/add PACKAGE=express make nodejs/add/dev PACKAGE=jest ```
Go
```bash
Install Go
make go/install
Build application
make go/app/build OUTPUT=myapp
Run tests
make go/app/test ```
Gitignore
```bash
Initialize gitignore for specific project types
make gitignore/init/web make gitignore/init/python make gitignore/init/node ```
Testing
To perform habits checks:
bash
make habits/check
Each technology-specific Makefile includes its own testing targets. For example:
```bash
Run Python tests
make python/test make python/test/coverage
Run Node.js tests
make nodejs/test
Run Go tests
make go/app/test make go/app/test/coverage ```
References
- GNU Make - GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files.
- Windows Subsystem for Linux (Ubuntu) - WSL enables you to use Linux tools, like Bash or Grep, completely integrated with Windows tools, like PowerShell or Visual Studio Code, with no need to dual-boot.
- Visual Studio Code - Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.
- VSCode Remote Development Extension Pack - An extension pack that lets you open any folder in a container, on a remote machine, or in WSL and take advantage of VS Code's full feature set.
- Git Submodules - Submodules allow you to keep a Git repository as a subdirectory of another Git repository.
- Docker - The fastest way to containerize applications
- Visual Studio DevContainers - The Visual Studio Code Dev Containers extension lets you use a Docker container as a full-featured development environment.
- Ansible - Ansible is an open source community project sponsored by Red Hat, it's the simplest way to automate IT.
- Jinja2 - Ansible uses Jinja2 templating to enable dynamic expressions and access to variables and facts.
- Terraform - Terraform is an infrastructure as code tool that lets you build, change, and version infrastructure safely and efficiently.
- AWS CDK - The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework to define cloud infrastructure in code and provision it through AWS CloudFormation.
- Python - Python is a programming language that lets you work quickly and integrate systems more effectively.
- Node.js - Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.
- Go - Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
License
This project is licensed under the MIT-0 License. See the LICENSE file.
Copyright
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Owner
- Name: Amazon Web Services - Labs
- Login: awslabs
- Kind: organization
- Location: Seattle, WA
- Website: http://amazon.com/aws/
- Repositories: 914
- Profile: https://github.com/awslabs
AWS Labs
GitHub Events
Total
- Release event: 1
- Watch event: 9
- Push event: 2
- Fork event: 1
- Create event: 1
Last Year
- Release event: 1
- Watch event: 9
- Push event: 2
- Fork event: 1
- Create event: 1
Issues and Pull Requests
Last synced: almost 2 years ago
All Time
- Total issues: 1
- Total pull requests: 18
- Average time to close issues: about 2 months
- Average time to close pull requests: 6 days
- Total issue authors: 1
- Total pull request authors: 4
- Average comments per issue: 1.0
- Average comments per pull request: 0.5
- Merged pull requests: 16
- Bot issues: 0
- Bot pull requests: 6
Past Year
- Issues: 1
- Pull requests: 3
- Average time to close issues: about 2 months
- Average time to close pull requests: 22 days
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 1.0
- Average comments per pull request: 0.33
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
Pull Request Authors
- valter-silva-au (9)
- github-actions[bot] (5)
- DavidS-ovm (2)
- nag0yan (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v3 composite
- actions/setup-python v4 composite
- google-github-actions/release-please-action v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite