Skip to content

Commit

Permalink
Merge 7675fc9 into 1ae68dc
Browse files Browse the repository at this point in the history
  • Loading branch information
LLKennedy committed Jun 25, 2019
2 parents 1ae68dc + 7675fc9 commit 23ab8c9
Show file tree
Hide file tree
Showing 28 changed files with 416 additions and 113 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
!LICENSE

# special cases
!internal/examples/**
!internal/vendor/examples/**
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: branch = master OR branch = develop OR branch =~ /release\/.*/ OR branch =~ /hotfix\/.*/ OR branch =~ /v[0-9]+[0-9.]*/
os: linux
go: 1.9.x
script: go test . ./components/... ./internal/filesystem ./render/... ./scaffold/... -race
script: go test ./... -race
- stage: "Build"
if: branch = master OR branch = develop OR branch =~ /release\/.*/ OR branch =~ /hotfix\/.*/ OR branch =~ /v[0-9]+[0-9.]*/
os: linux
Expand All @@ -21,7 +21,7 @@ jobs:
if: branch = master OR branch = develop OR branch =~ /release\/.*/ OR branch =~ /hotfix\/.*/ OR branch =~ /v[0-9]+[0-9.]*/
os: linux
go: 1.10.x
script: go test . ./components/... ./internal/filesystem ./render/... ./scaffold/... -race
script: go test ./... -race
- stage: "Build"
if: branch = master OR branch = develop OR branch =~ /release\/.*/ OR branch =~ /hotfix\/.*/ OR branch =~ /v[0-9]+[0-9.]*/
os: linux
Expand All @@ -31,7 +31,7 @@ jobs:
if: branch = master OR branch = develop OR branch =~ /release\/.*/ OR branch =~ /hotfix\/.*/ OR branch =~ /v[0-9]+[0-9.]*/
os: linux
go: 1.11.x
script: go test . ./components/... ./internal/filesystem ./render/... ./scaffold/... -race
script: go test ./... -race
- stage: "Build"
os: linux
go: 1.12.x
Expand All @@ -41,7 +41,7 @@ jobs:
go: 1.12.x
before_install: go get github.com/mattn/goveralls
script:
- go test . ./components/... ./internal/filesystem ./render/... ./scaffold/... -race -coverprofile=coverage.out
- go test ./... -race -coverprofile=coverage.out
- $GOPATH/bin/goveralls -coverprofile=coverage.out -service=travis-ci
- stage: "Build"
os: osx
Expand All @@ -50,12 +50,12 @@ jobs:
- stage: "Test"
os: osx
go: 1.12.x
script: go test . ./components/... ./internal/filesystem ./render/... ./scaffold/... -race
script: go test ./... -race
# - stage: "Build"
# os: windows
# go: 1.12.x
# script: go build
# - stage: "Test"
# os: windows
# go: 1.12.x
# script: go test . ./components/... ./internal/filesystem ./render/... ./scaffold/... -race
# script: go test ./... -race
91 changes: 91 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
4. You may merge the Pull Request in at your discretion once all build and test pipelines are passing.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team. All complaints will be reviewed and
investigated and will result in a response that is deemed necessary and
appropriate to the circumstances. The project team is obligated to maintain
confidentiality with regard to the reporter of an incident. Further details
of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ On windows, the simplest way to test is to use the powershell script.

To emulate the testing which occurs in build pipelines for linux and mac, run the following:

`go test . ./components/... ./render/... ./scaffold/... ./internal/filesystem -race -coverprofile=coverage.out;`
`go test ./... -race`
36 changes: 28 additions & 8 deletions components/barcode/barcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,35 @@ import (

// Component implements the Component interface for images
type Component struct {
/*
NamedPropertiesMap maps user/application variables to properties of the component.
This field is filled automatically by VerifyAndSetJSONData, then used in
SetNamedProperties to determine whether a variable being passed in is relevant to this
component.
For example, map[string][]string{"websiteURL": []string{"content"}} would indicate that
the user specified variable "websiteURL" will fill the Content property.
*/
NamedPropertiesMap map[string][]string
Content string
Type render.BarcodeType
TopLeft image.Point
Width int
Height int
DataColour color.NRGBA
BackgroundColour color.NRGBA
Extra render.BarcodeExtraData
// Content is the data which will be encoded as a barcode.
Content string
// Type is the sort of barcode to encode, such as QR, PDF, or two of five.
Type render.BarcodeType
/*
TopLeft is the coordinates of the top-left corner of the rendered barcode (including
background) relative to the top-left corner of the canvas.
*/
TopLeft image.Point
// Width is the width of the barcode (including background).
Width int
// Height is the height of the barcode (including background).
Height int
// DataColour is the colour which will fill the data channel.
DataColour color.NRGBA
// BackgroundColour is the colour which will fill the background channel.
BackgroundColour color.NRGBA
// Extra is additional information required by certain barcode types.
Extra render.BarcodeExtraData
}

type barcodeFormat struct {
Expand Down
21 changes: 18 additions & 3 deletions components/circle/circle.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,25 @@ import (

// Component implements the Component interface for circles
type Component struct {
/*
NamedPropertiesMap maps user/application variables to properties of the component.
This field is filled automatically by VerifyAndSetJSONData, then used in
SetNamedProperties to determine whether a variable being passed in is relevant to this
component.
For example, map[string][]string{"circleSize": []string{"radius"}} would indicate that
the user specified variable "circleSize" will fill the Radius property.
*/
NamedPropertiesMap map[string][]string
Centre image.Point
Radius int
Colour color.NRGBA
/*
Centre is the coordinates of the centre of the circle relative to the top-left corner
of the canvas.
*/
Centre image.Point
// Radius is the radius of the circle.
Radius int
// Colour is the colour of the circle.
Colour color.NRGBA
}

type circleFormat struct {
Expand Down
39 changes: 29 additions & 10 deletions components/datetime/datetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,36 @@ import (

// Component implements the Component interface for datetime
type Component struct {
/*
NamedPropertiesMap maps user/application variables to properties of the component.
This field is filled automatically by VerifyAndSetJSONData, then used in
SetNamedProperties to determine whether a variable being passed in is relevant to this
component.
For example, map[string][]string{"expiry": []string{"time"}} would indicate that
the user specified variable "expiry" will fill the Time property.
*/
NamedPropertiesMap map[string][]string
Time *time.Time
TimeFormat string
Start image.Point
Size float64
MaxWidth int
Alignment Alignment
Font *truetype.Font
Colour color.NRGBA
fs vfs.FileSystem
fontPool gosysfonts.Pool
// Time is the timestamp to render.
Time *time.Time
// TimeFormat is the format with which to parse a string-based time input.
TimeFormat string
// Start is the coordinates of the dot relative to the top-left corner of the canvas.
Start image.Point
// Size is the size of the text in points.
Size float64
// MaxWidth is the maximum number of horizontal pixels the dot can move before scaling text.
MaxWidth int
// Alignment aligns text to the left, right or centre.
Alignment Alignment
// Font is the typeface to use.
Font *truetype.Font
// Colour is the colour of the text.
Colour color.NRGBA
// fs is the file system.
fs vfs.FileSystem
// fontPool is the pool of available fonts.
fontPool gosysfonts.Pool
}

type datetimeFormat struct {
Expand Down
27 changes: 22 additions & 5 deletions components/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,29 @@ import (

// Component implements the Component interface for images
type Component struct {
/*
NamedPropertiesMap maps user/application variables to properties of the component.
This field is filled automatically by VerifyAndSetJSONData, then used in
SetNamedProperties to determine whether a variable being passed in is relevant to this
component.
For example, map[string][]string{"photo": []string{"fileName"}} would indicate that
the user specified variable "photo" will fill the Image property via an image file.
*/
NamedPropertiesMap map[string][]string
Image image.Image
TopLeft image.Point
Width int
Height int
fs vfs.FileSystem
// Image is the image to draw on the canvas.
Image image.Image
/*
TopLeft is the coordinates of the top-left corner of the image relative to the
top-left corner of the canvas.
*/
TopLeft image.Point
// Width is the width to scale the image to.
Width int
// Height is the height to scale the image to.
Height int
// fs is the file system.
fs vfs.FileSystem
}

type imageFormat struct {
Expand Down
2 changes: 1 addition & 1 deletion components/image/image_darwin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ func TestImageVerifyAndTestTextJSONDataOS(t *testing.T) {
}
})
}
}
}

0 comments on commit 23ab8c9

Please sign in to comment.