Skip to content

Commit 79e9c6c

Browse files
authored
Merge pull request #1 from deniscep/denisceplinting-fixes
Deniscep linting fixes
2 parents fa6dbdf + 70799e4 commit 79e9c6c

12 files changed

Lines changed: 64 additions & 63 deletions

File tree

README.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
1-
Python repository sample on how to build and layer your monorepo.
2-
This is a cookiecutter reusable template and the steps bellow explain how to reuse this repository.
1+
# Cookiecutter Python repository demonstrating how to construct and layer your monorepo
32

4-
## Cookiecutter - create template for Python repository
3+
This is a lightweight, reusable Python Cookiecutter template, containing main folder structure you would need for any Python project.
54

6-
1. In your project, in order to create templates, rename all your files/folders with the keyword 'cookiecutter' followed by the item name
7-
example: folder -> {{cookiecutter.documents}}
8-
python file -> {{cookiecutter.main}}.py
9-
2. Add cookiecutter.json at the root of your project where you define the templates you created
10-
3. Push the folder structure to your repo (Github, Azure Devops)
5+
Project contains a basic Python folder structure, Architecture Decision Record & documentation structure, pull request template, as well as CI/CD pipeline with super-linter.
116

12-
## Cookiecutter - reuse template from Github (windows)
7+
## Quickstart
138

14-
1. On your local create a new folder where you will store the repository you want to clone.
15-
2. Make sure your terminal is pointing to your new folder.
16-
3. Create a virtual environment: python -m venv environment
17-
4. Activate environment: .\environment\Scripts\activate
18-
5. Install cookiecutter lib for pyton: pip install cookiecutter
19-
6. Clone repo with cookiecutter: cookiecutter https://github.com/youruser/CookiecutterRepo.git (your github clone url)
9+
Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):
2010

21-
## Other tips
11+
```pip install -U cookiecutter```
2212

23-
1. When using step #6 from above, yout repo will be cloned in the .cookiecutter folder
24-
2. For working with a specific branch you can just copy its content in the .cookiecutter folder and use that version for testing
13+
Generate a Python package project:
2514

26-
## Documentation
15+
```https://github.com/microsoft/cookiecutter_template_for_python```
16+
17+
## Cookiecutter Documentation
2718

2819
- [cookiecutter-library](https://pypi.org/project/cookiecutter-python/)
2920
- [cookie-cutter-documentation](https://cookiecutter.readthedocs.io/en/stable/)
@@ -44,8 +35,8 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio
4435

4536
## Trademarks
4637

47-
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
48-
trademarks or logos is subject to and must follow
38+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
39+
trademarks or logos is subject to and must follow
4940
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
5041
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
5142
Any use of third-party trademarks or logos are subject to those third-party's policies.

SECURITY.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->
22

3-
## Security
3+
# Security
44

55
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
66

@@ -14,17 +14,17 @@ Instead, please report them to the Microsoft Security Response Center (MSRC) at
1414

1515
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
1616

17-
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
17+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
1818

1919
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
2020

21-
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22-
* Full paths of source file(s) related to the manifestation of the issue
23-
* The location of the affected source code (tag/branch/commit or direct URL)
24-
* Any special configuration required to reproduce the issue
25-
* Step-by-step instructions to reproduce the issue
26-
* Proof-of-concept or exploit code (if possible)
27-
* Impact of the issue, including how an attacker might exploit the issue
21+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
* Full paths of source file(s) related to the manifestation of the issue
23+
* The location of the affected source code (tag/branch/commit or direct URL)
24+
* Any special configuration required to reproduce the issue
25+
* Step-by-step instructions to reproduce the issue
26+
* Proof-of-concept or exploit code (if possible)
27+
* Impact of the issue, including how an attacker might exploit the issue
2828

2929
This information will help us triage your report more quickly.
3030

cookiecutter.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"project_name": "Your Project Name",
3-
"docs": "documents folder",
43
"infra": "infrastructure as code",
5-
"libs": "3rd party libraries",
64
"python_project": "your python project name",
75
"_copy_without_render": [
86
"*.html",

{{cookiecutter.project_name}}/.github/pull_request_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# PR Name
2+
13
Please give a proper description of your PR:
24

35
- This PR is about adding this feature
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
## Project
2-
This is a python repository sample on how to build and layer your monorepo.
3-
This example uses Github Actions and Terraform.
1+
# Project
2+
3+
This repository provides a sample of how to construct and organize a Python monorepo.
4+
The sample utilizes Github Actions and Terraform.
45

56
## Structure example description
7+
68
.
7-
├── .github # Github Action folders that enables for CI and CD for your repo
9+
├── .github # Github Action folders for CI and CD for your repo
810
│ ├── actions # Add custom actions
911
│ ├── scripts # Add custom scripts
1012
│ ├── workflows # Build your Github Actions by adding a workflow file
1113
├── documents # Documentation about the project
1214
│ ├── design # Add your designs and architectures here
15+
│ ├── assets # Holds binary content like 'jpg', 'png', 'css', etc.
1316
│ ├── spikes # Holds code samples for investigation
1417
│ ├── adr # ADR (Architecture Decision Record)
15-
├── assets # Holds content like 'jpg', 'img', 'css', 'fonts's
18+
│ ├── assets # Holds binary content like 'jpg', 'png', 'css', etc.
19+
├── assets # Holds binary content like 'jpg', 'png', 'css', etc.
1620
├── infrastructure # Holds your infrastructure as code, in our case Terraform
1721
│ ├── terraform # Holds all terraform files
1822
│ ├── variables # Holds all terraform variables
@@ -21,10 +25,9 @@ This example uses Github Actions and Terraform.
2125
│ ├── python-solution
2226
├── README.md
2327

24-
## CI pipeline
25-
This is an initial sample of a CI pipeline for our repository. The pipeline uses super-linter which is a combination of linters, in order to validate the entire source code.
26-
This means that python, yaml, .md and tf files will be validated all together, based on current configuration
27-
Code secrets scan to ensure no sensitive information or credentials are being committed.
28+
## CI pipeline
29+
30+
This is a base sample of a continuous integration (CI) pipeline for the repository. The pipeline uses super-linter, a fusion of multiple linters, to validate the entire source code, including Python, YAML, .md, and TF files, as specified in the current configuration. It also performs a code secrets scan to verify that no confidential information or credentials are being committed.
2831

2932
## Template for pull request
3033

@@ -35,4 +38,4 @@ In the .github folder there is a pull_request_template.md which contains an exam
3538
- [super-linter](https://github.com/github/super-linter)
3639
- [github-actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions)
3740
- [monorepo](https://www.atlassian.com/git/tutorials/monorepos)
38-
- [terrafrom](https://developer.hashicorp.com/terraform/intro)
41+
- [terrafrom](https://developer.hashicorp.com/terraform/intro)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 0001 - Record architecture decisions
2+
3+
Date: 2023-01-01
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
We need to record the architectural decisions made on this project
12+
13+
## Decision drivers
14+
15+
Recording decisions will help us keep track of what choices have been made and why.
16+
17+
## Considered options
18+
19+
- not recording decisions
20+
- recording decisions outside of repository
21+
22+
## Decision
23+
24+
We will use Architecture Decision Records, as described by Michael Nygard in the article [Documenting Architecture Decisions](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions)
25+
26+
## Consequences
27+
28+
See Michael Nygard's article, linked above. For a lightweight markdown template, see this [Gist](https://gist.github.com/christoferlof/215664f3cc938a72fa498600bfdb0a8a)

{{cookiecutter.project_name}}/.github/workflows/.gitkeep renamed to {{cookiecutter.project_name}}/docs/adr/assets/.gitkeep

File renamed without changes.

{{cookiecutter.project_name}}/src/{{cookiecutter.python_project}}/.gitkeep renamed to {{cookiecutter.project_name}}/docs/design/assets/.gitkeep

File renamed without changes.

{{cookiecutter.project_name}}/{{cookiecutter.docs}}/design/.gitkeep renamed to {{cookiecutter.project_name}}/docs/spikes/.gitkeep

File renamed without changes.

{{cookiecutter.project_name}}/{{cookiecutter.docs}}/spikes/.gitkeep renamed to {{cookiecutter.project_name}}/libs/.gitkeep

File renamed without changes.

0 commit comments

Comments
 (0)