Skip to content
Permalink
Browse files

Merge pull request #4 from vmarkovtsev/master

goimports + docs
  • Loading branch information...
vmarkovtsev committed Oct 8, 2019
2 parents 51fde06 + 6cf5918 commit a0dc744a31f93d3ac6842de508b717275100c653
Showing with 153 additions and 3 deletions.
  1. +3 −0 .travis.yml
  2. +73 −0 CODE_OF_CONDUCT.md
  3. +53 −0 CONTRIBUTING.md
  4. +1 −0 MAINTAINERS
  5. +19 −1 README.md
  6. +3 −0 file.go
  7. +1 −2 file_test.go
@@ -19,6 +19,7 @@ matrix:
before_install:
- go get -v golang.org/x/lint/golint
- go get -v github.com/haya14busa/goverage
- go get -v golang.org/x/tools/cmd/goimports

install:
- go mod download
@@ -28,6 +29,8 @@ script:
- export PATH=$PATH:$HOME
- fmt_warns=$(gofmt -s -l .)
- if [ ! -z "$fmt_warns" ]; then echo "$fmt_warns"; exit 1; fi
- import_warns=$(goimports -l .)
- if [ ! -z "$import_warns" ]; then echo "$import_warns"; exit 1; fi
- go vet ./...
- lint_warns=$(golint ./... | grep -v vendor/) || true
- if [ ! -z "$lint_warns" ]; then echo "$lint_warns"; exit 1; fi
@@ -0,0 +1,73 @@
# Contributor Covenant 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,
education, socio-economic status, 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 at conduct@sourced.tech. 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 https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
@@ -0,0 +1,53 @@
# Contributing Guidelines

go-asdf project is [Apache 2.0 licensed](LICENSE) and accepts
contributions via GitHub pull requests. This document outlines some of the
conventions on development workflow, commit message formatting, contact points,
and other resources to make it easier to get your contribution accepted.

## Certificate of Origin

By contributing to this project you agree to the [Developer Certificate of
Origin (DCO)](DCO). This document was created by the Linux Kernel community and is a
simple statement that you, as a contributor, have the legal right to make the
contribution.

In order to show your agreement with the DCO you should include at the end of commit message,
the following line: `Signed-off-by: John Doe <john.doe@example.com>`, using your real name.

This can be done easily using the [`-s`](https://github.com/git/git/blob/b2c150d3aa82f6583b9aadfecc5f8fa1c74aca09/Documentation/git-commit.txt#L154-L161) flag on the `git commit`.


## Support Channels

The official support channels, for both users and contributors, are:

- GitHub [issues](https://github.com/src-d/go-asdf/issues)*
- Slack: #machine-learning room in the [source{d} Slack](https://join.slack.com/t/sourced-community/shared_invite/enQtMjc4Njk5MzEyNzM2LTFjNzY4NjEwZGEwMzRiNTM4MzRlMzQ4MmIzZjkwZmZlM2NjODUxZmJjNDI1OTcxNDAyMmZlNmFjODZlNTg0YWM)

*Before opening a new issue or submitting a new pull request, it's helpful to
search the project - it's likely that another user has already reported the
issue you're facing, or it's a known issue that we're already aware of.
## How to Contribute
Pull Requests (PRs) are the main and exclusive way to contribute to the official go-asdf project.
In order for a PR to be accepted it needs to pass a list of requirements:
- All PRs must be written in idiomatic Go, formatted according to [gofmt -s](https://golang.org/cmd/gofmt/), [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), and without any warnings from [go lint](https://github.com/golang/lint) nor [go vet](https://golang.org/cmd/vet/).
- New features should be generally covered with tests.
- The test suite must pass.
- All PRs have to pass the personal evaluation of at least one of the [maintainers](MAINTAINERS).
### Format of the commit message
The commit summary must start with a capital letter and with a verb in present tense. No dot in the end.
```
Add a feature
Remove unused code
Fix a bug
```
Every commit details should describe what was changed, under which context and, if applicable, the GitHub issue it relates to.
@@ -0,0 +1 @@
Vadim Markovtsev <vadim@sourced.tech> (@vmarkovtsev)
@@ -1,3 +1,21 @@
# go-asdf [![GoDoc](https://godoc.org/github.com/src-d/go-asdf?status.svg)](http://godoc.org/github.com/src-d/go-asdf) [![Build Status](https://travis-ci.com/src-d/go-asdf.svg?branch=master)](https://travis-ci.com/src-d/go-asdf) [![codecov](https://codecov.io/github/src-d/go-asdf/coverage.svg)](https://codecov.io/gh/src-d/go-asdf) [![Go Report Card](https://goreportcard.com/badge/github.com/src-d/go-asdf)](https://goreportcard.com/report/github.com/src-d/go-asdf) [![Apache 2.0 license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

[Advanced Scientific Data Format](https://github.com/spacetelescope/asdf-standard) reader in pure Go.
[Advanced Scientific Data Format](https://github.com/spacetelescope/asdf-standard) reader library in pure Go.

The blocks are eagerly read and uncompressed. The tree is mapped with [gabs](https://github.com/Jeffail/gabs).

### Usage

```go
import "github.com/src-d/go-asdf"
fmt.Println(asdf.OpenFile("path/to/file.asdf", nil).Tree)
```

### Contributions

...are welcome, see [CONTRIBUTING](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md).

### License

Apache 2.0, see [LICENSE](LICENSE).
@@ -46,6 +46,9 @@ func OpenFile(fileName string, progress ProgressCallback) (*File, error) {
// Open reads ASDF from a seekable reader.
func Open(reader io.ReadSeeker, progress ProgressCallback) (*File, error) {
file := &File{}
if progress == nil {
progress = func(_, _ int) {}
}
progress(0, 2)
var err error
file.FormatVersion, file.StandardVersion, err = parseHeader(reader)
@@ -9,8 +9,7 @@ import (

func TestOpenFile(t *testing.T) {
req := require.New(t)
asdfFile, err := OpenFile("testdata/default.asdf",
func(done, total int) {})
asdfFile, err := OpenFile("testdata/default.asdf", nil)
req.NoError(err)
req.NotNil(asdfFile)
}

0 comments on commit a0dc744

Please sign in to comment.
You can’t perform that action at this time.