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

Introduce style guide #88

Merged
merged 28 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
82770f1
Add Style Guide
corvus-ch Sep 7, 2020
e3ed14c
Add EditorConfig
corvus-ch Sep 7, 2020
107289b
Fix white spaces according to EditorConfig
corvus-ch Sep 7, 2020
c539670
Add Style Guide content
corvus-ch Sep 7, 2020
72c04ee
Link style and label guide in contribution guide
corvus-ch Sep 7, 2020
496ab7f
Apply suggestions from code review
corvus-ch Sep 7, 2020
708d1c0
Mention the use of Vale and the Microsoft Style
corvus-ch Sep 7, 2020
67b4df1
Apply suggestions from code review
corvus-ch Sep 7, 2020
e07c093
Apply suggestions from code review
corvus-ch Sep 8, 2020
9cc99ea
Clarify usage of `\n`
corvus-ch Sep 8, 2020
e04d463
Use sentence case titles
corvus-ch Sep 8, 2020
2e577d9
Be explicit about jsonnet fmt options
corvus-ch Sep 8, 2020
1df58f3
Clarify on whitespaces with brackets
corvus-ch Sep 8, 2020
0df1145
Explain usage of tailing `,`
corvus-ch Sep 8, 2020
73ad83d
Use native terms of Jsonnet
corvus-ch Sep 8, 2020
784c0ef
Add `@returns` in example
corvus-ch Sep 8, 2020
c502d2f
Fix language style
corvus-ch Sep 8, 2020
7eadd98
Apply suggestions from code review
corvus-ch Sep 8, 2020
33012f7
Libraries should not be materialized
corvus-ch Sep 8, 2020
d6b8c49
Clarify usage of `jsonnetfmt`
corvus-ch Sep 8, 2020
1705d5e
Apply suggestions from code review
corvus-ch Sep 9, 2020
80d1a50
Clarify where open brakets shall go
corvus-ch Sep 9, 2020
992b774
Define how to handle thins within conditionals
corvus-ch Sep 9, 2020
37a5143
Apply suggestions from code review
corvus-ch Sep 11, 2020
5f863ad
Make example work
corvus-ch Sep 11, 2020
f365590
Use CORRECT/INCORRECT as in other examples
corvus-ch Sep 11, 2020
3f695b0
Make example to be alinged with guide
corvus-ch Sep 11, 2020
8e2e3d2
Use `\` instead of `@` in Docblocks
corvus-ch Sep 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at https://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{y*ml,*json*,*sonnet}]
indent_style = space
indent_size = 2

[*.*sonnet]
# C-style doc comments
block_comment_start = /*
block_comment = *
block_comment_end = */

[.gitkeep]
insert_final_newline = false

[Makefile]
indent_style = tab
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ jobs:
- name: Run ${{ matrix.command }}
run: make ${{ matrix.command }}

editorconfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: snow-actions/eclint@v1.0.1
with:
args: 'check'

docs:
runs-on: ubuntu-latest
steps:
Expand Down
12 changes: 6 additions & 6 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Copyright (c) 2019, VSHN AG, info@vshn.ch
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand All @@ -24,4 +24,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ include::steward:ROOT:partial$nav-howtos.adoc[]
--

.Technical reference
* xref:references/style-guide.adoc[Style Guide]
* xref:references/labels-guide.adoc[Labels Guide]
* Commodore
+
Expand Down
1 change: 0 additions & 1 deletion docs/modules/ROOT/pages/.vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ MinAlertLevel = warning # suggestion, warning or error
# Using the Microsoft style
BasedOnStyles = Microsoft
Microsoft.GenderBias = warning

2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/about/architecture.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Configuration Git repositories ^ |
|Configuration generator leveraging a hierarchical configuration model. Uses https://kapitan.dev/[Kapitan] under the hood.

|xref:lieutenant-operator:ROOT:index.adoc[Lieutenant Operator]
|Manages the CRDs `Cluster`, `Tenant`, `GitRepo`. Implements the business logic for handling all aspects around Git repositories for clusters and tenants.
|Manages the CRDs `Cluster`, `Tenant`, `GitRepo`. Implements the business logic for handling all aspects around Git repositories for clusters and tenants.

|xref:lieutenant-api:ROOT:index.adoc[Lieutenant API]
|REST API to expose the functionality of the Lieutenant Operator and to enforce some defaults.
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/about/community.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ https://github.com/projectsyn[GitHub]:: The source code and issue tracking is av
[discrete]
== Project sponsor

The project is sponsored by https://vshn.ch/[VSHN AG]. If you ever need support for Project Syn, have a look at https://kb.vshn.ch/products/vss_intro.html[VSHN Syn Support].
The project is sponsored by https://vshn.ch/[VSHN AG]. If you ever need support for Project Syn, have a look at https://kb.vshn.ch/products/vss_intro.html[VSHN Syn Support].
5 changes: 3 additions & 2 deletions docs/modules/ROOT/pages/about/contribution_guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ done (read more about http://help.github.com/pull-requests/[pull requests]).

== Coding conventions

=== Commodore Components
See:

We're using `jsonnetfmt` and `yamllint` to ensure consistency. The `Makefile` provides targets to invoke them.
* xref:references/style-guide.adoc[Style Guide]
* xref:references/labels-guide.adoc[Labels Guide]
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/about/glossary.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Synthesize::

Make a Kubernetes cluster Project Syn managed.
This is done by registering a cluster in Lieutenant and installing Steward
on the target cluster.
on the target cluster.
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/how-tos/release-process.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ If a "major" release is being done, the following additional work needs to be do

* Update the https://github.com/projectsyn/documentation/blob/master/docs/modules/ROOT/pages/roadmap.adoc[Roadmap]
* Write a blogpost and spread it on social media
* Close the associated GitHub project and internal Jira project (if applicable)
* Close the associated GitHub project and internal Jira project (if applicable)