Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise README and STYLEGUIDE #48

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitchangelog/.gitchangelog.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ ignore_regexps = [
]

section_regexps = [
('Added', [r'^([aA]dd|[cC]reate)\s*']),
('Changed', [r'^([cC]hange|[rR]efactor|[uU]pdate|[mM]ove)\s*']),
('Added', [r'^([aA]dd|[cC]reate|[iI]mplement)\s*']),
('Changed', [r'^([cC]hange|[rR]efactor|[uU]pdate|[mM]ove|[rR]evise)\s*']),
('Deprecated', [r'^[dD]eprecate\s*']),
('Removed', [r'^([rR]emove|[dD]elete)\s*']),
('Fixed', [r'^[fF]ix\s*']),
('Fixed', [r'^([fF]ix|[rR]epair)\s*']),
('Security', [r'^[sS]ecure\s*']),
('Other', None)
]
Expand Down
40 changes: 3 additions & 37 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ permissions:
contents: write

jobs:
pull-request-update-changelog:
if: github.event_name == 'pull_request' || github.event.pull_request.merged == true
update-changelog:
if: github.event.pull_request.merged == true || github.event_name == 'release'
name: "Update Changelog"
runs-on: ubuntu-latest

Expand Down Expand Up @@ -44,42 +44,8 @@ jobs:
commit_message: 'Update Changelog (!automated)'
branch: master

release-update-changelog:
if: github.event_name == 'release'
name: "Update Changelog (Release)"
runs-on: ubuntu-latest

steps:
- name: 'Generate Token'
uses: actions/create-github-app-token@v1
id: token-generator
with:
app-id: ${{ secrets.TOKEN_GENERATOR_APP_ID }}
private-key: ${{ secrets.TOKEN_GENERATOR_PRIVATE_KEY }}

- name: 'Checkout Branch'
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
token: ${{ steps.token-generator.outputs.token }}

- name: 'Initialize Environment'
uses: ./.github/actions/initialize-environment

- name: 'Generate Changelog'
run: |
make generate_changelog

- name: 'Push Changes'
if: success()
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'Update Changelog (!automated)'
branch: master

- name: 'Retag Release'
if: success()
if: github.event_name == 'release' && success()
uses: EndBug/latest-tag@latest
with:
ref: ${{ github.event.release.tag_name }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ about but haven't gotten the professional opportunity to try.

## Current state:

All changes can now be viewed in the [CHANGELOG](https://github.com/wesker-albert/cibo/CHANGELOG.md),
All changes can now be viewed in the [CHANGELOG](CHANGELOG.md),
which is automatically generated in-house via a fork of [gitchangelog](https://github.com/wesker-albert/gitchangelog).
45 changes: 29 additions & 16 deletions STYLEGUIDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Style Guide

Nitpicking is welcomed and encouraged, just as much as pushback.
Nitpicking is welcomed and encouraged, and so is pushback.

## General Principles

Expand All @@ -10,14 +10,25 @@ Nitpicking is welcomed and encouraged, just as much as pushback.
existing patterns, please suggest them.
- Always be ` a e s t h e t i c `.

## Editor

This project is fully intended to be worked on using VS Code.

We leverage dev containers to make sure the local dev environment is clean and
homogenous. There are also a bunch of meticulously curated stylistic settings, rules
and recommended extensions included.

Please use VS Code when interacting with this project.

## File Structure

We don't like huge monolithic files here. We prefer thoughtful, bitesized files that
preferably contain reusable patterns. With the exception of text or JSON documents,
and within reason, please try to keep lines of code under 300 per file.
and within reason, please try to keep under 300 lines of code per file.

Directory structure is also preferred to be kept as flat as possible, without being
cluttersome. Introducing sub-directories should be thoughtfully planned, and discussed.
cluttersome. Introducing sub-directories should be thoughtfully planned, and
discussed.

## CHANGELOG

Expand All @@ -28,38 +39,40 @@ release is published. Don't worry about updating it manually.

PR naming is kind of important, for reasons I'll later point out.

- First letter should be capitalized.
- No period at the end necessary.
- Should be no langer than a brief sentence.
- Follow [APA-style title case](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case).
- No period at the end.
- No longer than a brief sentence.

Including the substrings `!ignore` or `!automated` will result in the PR not showing
up in the CHANGELOG.

Names should begin with one of the following *present-tense* verbs:
- Add, Create
- Change, Refactor, Update, Move
**Names should begin with one of the following *present-tense* verbs**:
- Add, Create, Implement
- Change, Refactor, Update, Move, Revise
- Deprecate
- Remove, Delete
- Fix
- Fix, Repair
- Secure

One reason for the above, is the CHANGELOG generator looks for these terms, and then
will categorize the merge commits accordingly. The second reason is that it makes
git log searching much easier and more reliable.
will [categorize the merge commits](.gitchangelog/.gitchangelog.rc#L10-L18)
accordingly.

Naming of individual branch commits don't adhere to any specific requirements, just
don't go too wild.
Another reason is that it makes git log searching much easier and more reliable.

## Makefile

Make the Makefile work for you. If you find you're constantly reusing a specific
terminal command while working in this repository, it may be a good addition and
useful alias for others.


## Python

OOP is king.

This project leverages some pretty strong automated linting, formatting, and type
checking libraries. PR requests should be denied if there are any failures within.
checking libraries. Pull requests will not pass checks if there are any failures
within.

In-code disabling of linting or checking rules is highly frowned upon. Very, very
seldomly it may be necessary, primarily due to bugs or limitations with the tools we
Expand Down