Skip to content

Commit cc47976

Browse files
Modernize project structure and CI workflows (#173)
* Modernize project structure and CI workflows Adopt python-repo-template best practices: update Makefile with comprehensive targets, switch to poetry-core, add black and flake8 for code quality, and move tests to the repo root. Overhaul GitHub Actions workflows (CI, Snyk, secrets scan, stale issues), improve dependabot config, and add cursor rules for development standards. Update README, LICENSE, and CHANGELOG to reflect new structure and tooling. * Add community and contribution docs, update templates Added CODE_OF_CONDUCT.md, CONTRIBUTING.md, SECURITY.md, and changelog reference to README. Introduced GitHub issue and feature request templates, and updated the pull request template for clarity. Minor improvements to test files and documentation for better project maintainability and contributor guidance. * Remove trailing spaces in bug report template Cleaned up formatting by removing trailing spaces from the default values in the bug report issue template. * Update .github/workflows/ci.yml Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com> * Update .github/ISSUE_TEMPLATE/config.yml Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com> * Update Makefile * Update config.yml --------- Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com>
1 parent e604415 commit cc47976

33 files changed

+1435
-825
lines changed

.codecov.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ coverage:
22
precision: 2
33
round: down
44
range: 70...100
5-
65
status:
76
project: true
87
patch: false
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
description: General coding standards (language-agnostic)
3+
globs: ["**/*"]
4+
alwaysApply: true
5+
---
6+
7+
# General Coding Standards
8+
9+
## Documentation & Instructions
10+
11+
- **Be concise** - Instructions, rules, and documentation should be brief and actionable
12+
- **Focus on essentials** - Include only what's necessary, remove verbose explanations
13+
14+
## File Formatting
15+
16+
- **End files with newline** - POSIX standard, required for Git diffs
17+
- **Use LF (`\n`) line endings** - Not CRLF (`\r\n`), except `.bat`/`.cmd` files
18+
- **No trailing whitespace** - Remove spaces/tabs at end of lines
19+
- **Consistent indentation** - Spaces or tabs, never mixed
20+
21+
## File Naming
22+
23+
- **Lowercase with hyphens** - `my-file.txt` not `My-File.txt`
24+
- **Be descriptive** - `user-authentication.py` not `auth.py`
25+
- **Avoid special characters** - Use only `a-z`, `0-9`, `-`, `_`, `.`
26+
27+
**Exceptions:**
28+
- Python: `snake_case.py`
29+
- JavaScript/TypeScript: `PascalCase.tsx`
30+
31+
## Git
32+
33+
**Commits:**
34+
- Atomic (one change per commit)
35+
- Present tense messages ("Add feature" not "Added feature")
36+
- Include issue numbers (`Fixes #123`)
37+
38+
**Never commit:**
39+
- ❌ Build artifacts (`dist/`, `build/`)
40+
- ❌ Dependencies (`node_modules/`, `.venv/`)
41+
- ❌ IDE files (`.vscode/`, `.idea/`)
42+
- ❌ OS files (`.DS_Store`, `Thumbs.db`)
43+
- ❌ Secrets or credentials
44+
45+
## Security
46+
47+
- **Never commit secrets** - Use environment variables
48+
- **Pin dependency versions** - Use exact versions
49+
- **Use secret scanners** - gitleaks, truffleHog
50+
- **Security scanning** - Snyk, Dependabot
51+
52+
## Before Committing
53+
54+
- [ ] Tests pass
55+
- [ ] No linter errors
56+
- [ ] No trailing whitespace
57+
- [ ] Newline at end of files
58+
- [ ] No debug code
59+
- [ ] Documentation updated

.cursor/rules/makefile-python.mdc

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
description: Makefile-based development workflow for Python projects using Poetry
3+
globs: ["Makefile", "pyproject.toml", "**/*.py"]
4+
alwaysApply: true
5+
---
6+
7+
# Python Project Development Workflow
8+
9+
## Available Makefile Targets
10+
11+
### Setup
12+
- `make setup-init` - Complete first-time setup (configure venv, lock, install all deps)
13+
- `make setup-venv` - Configure Poetry to use .venv in project directory
14+
15+
### Installation
16+
- `make install` - Install main dependencies only
17+
- `make install-dev` - Install main + dev dependencies
18+
- `make install-test` - Install main + test dependencies
19+
- `make install-all` - Install all dependencies (main + dev + test)
20+
21+
### Dependency Management
22+
- `make lock` - Regenerate poetry.lock from pyproject.toml
23+
- `make update-deps` - Update dependencies to latest compatible versions
24+
25+
### Testing
26+
- `make test` - Run unit tests without coverage
27+
- `make test-with-coverage` - Run unit tests with coverage reporting
28+
29+
### Code Quality
30+
- `make lint-python` - Lint Python code with flake8
31+
- `make lint-yaml` - Lint YAML files with yamllint
32+
- `make format-python` - Format Python code with black
33+
- `make pre-commit` - Run all quality checks (format, lint, test)
34+
35+
### Build
36+
- `make build` - Build the Python package
37+
38+
### Cleanup
39+
- `make clean` - Clean test artifacts, build artifacts and temporary files
40+
- `make clean-all` - Clean everything including virtual environment
41+
42+
### Help
43+
- `make help` - Show all available targets
44+
45+
## Project Setup
46+
47+
**Quick Start:**
48+
```bash
49+
make setup-init # Complete first-time setup
50+
make test-with-coverage # Verify installation
51+
```
52+
53+
## Python Environment
54+
- **Poetry** - Dependency management
55+
- **Python 3.10+** - Minimum version (supports 3.10, 3.11, 3.12, 3.13)
56+
- **`.venv/`** - Virtual environment (project-local)
57+
- **Dependencies** in `pyproject.toml`:
58+
- Main: boto3, click, InquirerPy
59+
- Test: pytest, pytest-cov, pytest-mock, coverage, mock
60+
- Dev: black, flake8, yamllint
61+
62+
## Development Workflow
63+
64+
**Daily development:**
65+
```bash
66+
# 1. Make code changes
67+
# 2. Run all quality checks before committing
68+
make pre-commit # Format, lint, and test everything
69+
# Or run individual checks:
70+
make format-python # Auto-format
71+
make lint-python # Lint Python
72+
make lint-yaml # Lint YAML
73+
make test-with-coverage # Test with coverage
74+
make clean # Remove artifacts
75+
```
76+
77+
## Project Structure
78+
- Main package: `saml2awsmulti/`
79+
- Tests: `tests/`
80+
- CLI entry point: `awslogin` (defined in pyproject.toml)
81+
- Configuration: `pyproject.toml`
82+
83+
## CLI Tool Usage
84+
After installation with `pip install .` or `pipx install .`:
85+
```bash
86+
awslogin # Main CLI tool
87+
awslogin --help # Show help
88+
awslogin switch # Switch AWS profile
89+
awslogin whoami # Show current identity
90+
```

.cursor/rules/makefile-workflow.mdc

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Bug Report
2+
description: Report a bug or unexpected behavior
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to report a bug!
10+
11+
- type: textarea
12+
id: description
13+
attributes:
14+
label: Bug Description
15+
description: A clear and concise description of what the bug is
16+
placeholder: What happened?
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: reproduction
22+
attributes:
23+
label: Steps to Reproduce
24+
description: Steps to reproduce the behavior
25+
placeholder: |
26+
1. Go to '...'
27+
2. Run command '...'
28+
3. See error
29+
validations:
30+
required: true
31+
32+
- type: textarea
33+
id: expected
34+
attributes:
35+
label: Expected Behavior
36+
description: What you expected to happen
37+
placeholder: What should have happened?
38+
validations:
39+
required: true
40+
41+
- type: textarea
42+
id: actual
43+
attributes:
44+
label: Actual Behavior
45+
description: What actually happened
46+
placeholder: What actually happened?
47+
validations:
48+
required: true
49+
50+
- type: textarea
51+
id: environment
52+
attributes:
53+
label: Environment
54+
description: Please provide your environment details
55+
placeholder: |
56+
- OS: [e.g., Ubuntu 22.04, Windows 11, macOS 13]
57+
- Python version: [e.g., 3.11.5]
58+
- Project version: [e.g., 1.0.0]
59+
value: |
60+
- OS:
61+
- Python version:
62+
- Project version:
63+
validations:
64+
required: true
65+
66+
- type: textarea
67+
id: logs
68+
attributes:
69+
label: Relevant Logs
70+
description: Please paste any relevant log output
71+
render: shell
72+
73+
- type: textarea
74+
id: additional
75+
attributes:
76+
label: Additional Context
77+
description: Add any other context about the problem here

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Question or Discussion
4+
url:
5+
about: Ask questions or start discussions about the project
6+
- name: Security Vulnerability
7+
url: https://github.com/kyhau/.github/security/advisories/new
8+
about: Report security vulnerabilities privately
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Feature Request
2+
description: Suggest a new feature or enhancement
3+
title: "[Feature]: "
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for suggesting a new feature!
10+
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: Problem Statement
15+
description: Is your feature request related to a problem? Please describe.
16+
placeholder: I'm always frustrated when...
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: solution
22+
attributes:
23+
label: Proposed Solution
24+
description: Describe the solution you'd like
25+
placeholder: I would like to see...
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: alternatives
31+
attributes:
32+
label: Alternatives Considered
33+
description: Describe any alternative solutions or features you've considered
34+
placeholder: I also considered...
35+
36+
- type: textarea
37+
id: benefits
38+
attributes:
39+
label: Benefits
40+
description: What are the benefits of this feature?
41+
placeholder: This would help by...
42+
43+
- type: textarea
44+
id: additional
45+
attributes:
46+
label: Additional Context
47+
description: Add any other context, mockups, or examples about the feature request here

.github/dependabot.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
version: 2
22
updates:
3+
# GitHub Actions dependencies
34
- package-ecosystem: github-actions
45
directory: "/"
56
groups:
@@ -11,18 +12,7 @@ updates:
1112
time: "08:00"
1213
timezone: Australia/Melbourne
1314

14-
- package-ecosystem: pip
15-
directory: "/"
16-
groups:
17-
all-dependencies:
18-
patterns:
19-
- "*"
20-
schedule:
21-
interval: weekly
22-
time: "09:00"
23-
timezone: Australia/Melbourne
24-
open-pull-requests-limit: 1
25-
15+
# Python dependencies managed by Poetry
2616
- package-ecosystem: poetry
2717
directory: "/"
2818
groups:
@@ -31,6 +21,6 @@ updates:
3121
- "*"
3222
schedule:
3323
interval: weekly
34-
time: "09:30"
24+
time: "08:00"
3525
timezone: Australia/Melbourne
3626
open-pull-requests-limit: 1

0 commit comments

Comments
 (0)