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

docs: baseline all the templated markdown docs #85

Merged
merged 2 commits into from
Jan 30, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE

This file was deleted.

24 changes: 0 additions & 24 deletions .github/PULL_REQUEST_TEMPLATE

This file was deleted.

82 changes: 57 additions & 25 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,73 @@
# SendGrid Community Code of Conduct
# Contributor Covenant Code of Conduct

The SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, successful and growing community.
## Our Pledge

### Be Open
Members of the community are open to collaboration, whether it's on pull requests, code reviews, approvals, issues or otherwise. We're receptive to constructive comments and criticism, as the experiences and skill sets of all members contribute to the whole of our efforts. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate, and everyone can make a difference.
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, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

### Be Considerate
Members of the community are considerate of their peers, which include other contributors and users of SendGrid. We're thoughtful when addressing the efforts of others, keeping in mind that often the labor was completed with the intent of the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views.
## Our Standards

### Be Respectful
Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally.
Examples of behavior that contributes to creating a positive environment
include:

## Additional Guidance
- 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

### Disclose Potential Conflicts of Interest
Community discussions often involve interested parties. We expect participants to be aware when they are conflicted due to employment or other projects they are involved in and disclose those interests to other project members. When in doubt, over-disclose. Perceived conflicts of interest are important to address so that the community’s decisions are credible even when unpopular, difficult or favorable to the interests of one group over another.
Examples of unacceptable behavior by participants include:

### Interpretation
This Code is not exhaustive or complete. It is not a rulebook; it serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter. When in doubt, try to abide by [SendGrid’s cultural values](https://sendgrid.com/blog/employee-engagement-the-4h-way) defined by our “4H’s”: Happy, Hungry, Humble and Honest.
- 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

### Enforcement
Most members of the SendGrid community always comply with this Code, not because of the existence of this Code, but because they have long experience participating in open source communities where the conduct described above is normal and expected. However, failure to observe this Code may be grounds for suspension, reporting the user for abuse or changing permissions for outside contributors.
## Our Responsibilities

## If you have concerns about someone’s conduct
**Initiate Direct Contact** - It is always appropriate to email a community member (if contact information is available), mention that you think their behavior was out of line, and (if necessary) point them to this Code.
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.

**Discuss Publicly** - Discussing publicly is always acceptable. Note, though, that approaching the person directly may be better, as it tends to make them less defensive, and it respects the time of other community members, so you probably want to try direct contact first.
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.

**Contact the Moderators** - You can reach the SendGrid moderators by emailing [email protected].
## Scope

## Submission to SendGrid Repositories
Finally, just a reminder, changes to the SendGrid repositories will only be accepted upon completion of the [SendGrid Contributor Agreement](https://cla.sendgrid.com).
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 at [email protected]. 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

SendGrid thanks the following, on which it draws for content and inspiration:
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

* [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/)
* [Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct)
* [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html)
[homepage]: https://www.contributor-covenant.org
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Before you decide to create a new issue, please try the following:

### Please use our Bug Report Template

In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/smtpapi-go/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.
In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/smtpapi-go/ISSUE_TEMPLATE.md) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.

<a name="improvements-to-the-codebase"></a>
## Improvements to the Codebase
Expand Down
26 changes: 26 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
If this is a feature request, make sure you search Issues for an existing request before creating a new one!
-->

### Issue Summary
A summary of the issue and the environment in which it occurs. If suitable, include the steps required to reproduce the bug. Please feel free to include screenshots, screencasts, or code examples.

### Steps to Reproduce
1. This is the first step
2. This is the second step
3. Further steps, etc.

### Code Snippet
```go
# paste code here
```

### Exception/Log
```
# paste exception/log here
```

### Technical details:
* smtpapi-go version:
* go version:

16 changes: 8 additions & 8 deletions LICENSE.txt → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
The MIT License (MIT)
MIT License

Copyright (c) 2013-2020 Twilio SendGrid, Inc.
Copyright (C) 2020, Twilio SendGrid, Inc. <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ install:
go get -t -v ./...

test: install
diff -u <(echo -n) <(gofmt -d -s .)
go test -cover -bench=. -v -race ./...
go test -race -cover -v ./...
31 changes: 31 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines, then fill out the blanks below.

Please format the PR title appropriately based on the type of change:
<type>[!]: <description>
Where <type> is one of: docs, chore, feat, fix, test.
Add a '!' after the type for breaking changes (e.g. feat!: new breaking feature).

**All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.**

Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
e.g.
Fixes #1
Closes #2
-->

# Fixes #

A short description of what this PR does.

### Checklist
- [ ] I acknowledge that all my contributions will be made under the project's license
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
- [ ] I have read the [Contribution Guidelines](CONTRIBUTING.md) and my PR follows them
- [ ] I have titled the PR appropriately
- [ ] I have updated my branch with the master branch
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation about the functionality in the appropriate .md file
- [ ] I have added inline documentation to the code I modified

If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)

[![BuildStatus](https://travis-ci.org/sendgrid/smtpapi-go.svg?branch=master)](https://travis-ci.org/sendgrid/smtpapi-go)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)
[![Email Notifications Badge](https://dx.sendgrid.com/badge/php)](https://dx.sendgrid.com/newsletter/php)
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/smtpapi-go.svg)](https://github.com/sendgrid/smtpapi-go/graphs/contributors)
Expand Down Expand Up @@ -100,4 +100,4 @@ smtpapi-go is maintained and funded by SendGrid, Inc. The names and logos for sm

# License

[The MIT License (MIT)](LICENSE.txt)
[The MIT License (MIT)](LICENSE.md)
2 changes: 1 addition & 1 deletion smtpapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

// Version represents the current version of the smtpapi-go library
const Version = "0.4.2"
const Version = "0.6.2"

// SMTPAPIHeader will be used to set up X-SMTPAPI params
type SMTPAPIHeader struct {
Expand Down
42 changes: 12 additions & 30 deletions smtpapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package smtpapi

import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"reflect"
"regexp"
"strconv"
"strings"
"testing"
"time"
)
Expand All @@ -20,13 +19,6 @@ func exampleJson() map[string]interface{} {
return json
}

func TestSMTPAPIVersion(t *testing.T) {
t.Parallel()
if Version != "0.4.2" {
t.Error("SMTPAPI version does not match")
}
}

func TestNewSMTPIAPIHeader(t *testing.T) {
t.Parallel()
header := NewSMTPAPIHeader()
Expand Down Expand Up @@ -382,11 +374,11 @@ func TestRepoFiles(t *testing.T) {
/*
files := []string{"docker/Dockerfile", "docker/docker-compose.yml", ".env_sample",
".gitignore", ".travis.yml", ".codeclimate.yml", "CHANGELOG.md", "CODE_OF_CONDUCT.md",
"CONTRIBUTING.md", ".github/ISSUE_TEMPLATE", "LICENSE.txt", ".github/PULL_REQUEST_TEMPLATE",
"CONTRIBUTING.md", "ISSUE_TEMPLATE.md", "LICENSE.md", "PULL_REQUEST_TEMPLATE.md",
"README.md", "TROUBLESHOOTING.md", "USAGE.md", "USE_CASES.md"}
*/
files := []string{".env_sample", ".gitignore", ".travis.yml", "CHANGELOG.md", "CODE_OF_CONDUCT.md",
"CONTRIBUTING.md", ".github/ISSUE_TEMPLATE", "LICENSE.txt", ".github/PULL_REQUEST_TEMPLATE",
"CONTRIBUTING.md", "ISSUE_TEMPLATE.md", "LICENSE.md", "PULL_REQUEST_TEMPLATE.md",
"README.md", "TROUBLESHOOTING.md", "USAGE.md"}

for _, file := range files {
Expand All @@ -396,28 +388,18 @@ func TestRepoFiles(t *testing.T) {
}
}

func TestLicenceDate(t *testing.T) {
b, err := ioutil.ReadFile("./LICENSE.txt")

if err != nil {
t.Fatalf("cannot open license file; got %v", err)
}

r := regexp.MustCompile(`(\d+-\d+)`)
dates := r.FindString(string(b))

if dates == "" {
t.Fatal("cannot find licence date range in the license file")
}
func TestLicenseYear(t *testing.T) {
t.Parallel()
dat, err := ioutil.ReadFile("LICENSE.md")

lastDate := strings.Split(dates, "-")[1]
maxLicenseYear, err := strconv.Atoi(lastDate)
currentYear := time.Now().Year()
r := fmt.Sprintf("%d", currentYear)
match, _ := regexp.MatchString(r, string(dat))

if err != nil {
t.Fatalf("cannot convert licence date to int; got %v", err)
t.Error("License File Not Found")
}

if maxLicenseYear != time.Now().Year() {
t.Fatalf("end licence year must be %d; got %d", time.Now().Year(), maxLicenseYear)
if !match {
t.Error("Incorrect Year in License Copyright")
}
}