Skip to content

Commit

Permalink
Make README.md file a requirement
Browse files Browse the repository at this point in the history
Before the README file was not a requirement. But I think it is important that each package contains one. This also makes it possible to validate it is there. In the case of the system package, the README was there but with a typo and we didn't detect it.
  • Loading branch information
ruflin committed Mar 23, 2020
1 parent 5792b06 commit 0c9795f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

* Allow to set cache times through config. [#271](https://github.com/elastic/integrations-registry/pull/271)
* Make README.md file a required file for a package. [#](https://github.com/elastic/integrations-registry/pull/)

### Deprecated

Expand Down
3 changes: 3 additions & 0 deletions dev/packages/example/base-1.0.0/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Base package

This is installed in the background by EPM to setup the Elastic Stack.
3 changes: 3 additions & 0 deletions dev/packages/example/yamlpipeline-1.0.0/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# YAML Pipeline

Example package with a yaml pipeline.
4 changes: 2 additions & 2 deletions util/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ func NewPackage(basePath, packageName string) (*Package, error) {
readmePath := basePath + "/" + packageName + "/docs/README.md"
// Check if readme
readme, err := os.Stat(readmePath)
if err != nil && !os.IsNotExist(err) {
return nil, err
if err != nil {
return nil, fmt.Errorf("no readme file found, README.md is required: %s", err)
}

if readme != nil {
Expand Down

0 comments on commit 0c9795f

Please sign in to comment.