Skip to content

Add travis file to run checks #1

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

Merged
merged 1 commit into from
May 25, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sudo: false

language: go

os:
- linux

go:
- 1.10.x

before_install:
- make setup

script:
- make check
20 changes: 6 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,25 @@ generate:
$(MAKE) readme
$(MAKE) template

generate3:
python3 scripts/schemas.py
python3 scripts/use-cases.py

fmt:
find . -name *.py -exec autopep8 --in-place --max-line-length 120 {} \;

check:
#
# Validate that all generated changes are commited
$(MAKE) generate
$(MAKE) fmt

# Check if diff is empty
git diff | cat
git update-index --refresh
git diff-index --exit-code HEAD --

# Check python code
find . -name *.py -exec autopep8 --in-place --max-line-length 120 {} \; | \
(! grep . -q) || (echo "Code differs from autopep8's style" && false)

# Basic spell checking
go get github.com/client9/misspell
go get github.com/client9/misspell/cmd/misspell
misspell README.md CONTRIBUTING.md

setup:
pip install -Ur ./scripts/requirements.txt

setup3:
pip3 install -Ur ./scripts/requirements.txt
pip install --user --upgrade --requirement ./scripts/requirements.txt

clean:
rm schema.csv schema.md
Expand All @@ -47,4 +38,5 @@ readme:

template:
go get github.com/elastic/go-ucfg/yaml
go get github.com/elastic/beats/libbeat/template
go run scripts/template.go > ./template.json
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,11 @@ These are common to show up in web service logs coming from the parsed user agen
Below are some examples that demonstrate how ECS fields can be applied to
specific use cases.

* [Logging](https://github.com/elastic/ecs/blob/master/use-cases/logging.md)
* [APM](https://github.com/elastic/ecs/blob/master/use-cases/apm.md)
* [Filebeat Apache](https://github.com/elastic/ecs/blob/master/use-cases/filebeat-apache-access.md)
* [Beats](https://github.com/elastic/ecs/blob/master/use-cases/beats.md)
* [Auditbeat](https://github.com/elastic/ecs/blob/master/use-cases/auditbeat.md)
* [Beats](https://github.com/elastic/ecs/blob/master/use-cases/beats.md)
* [Filebeat Apache](https://github.com/elastic/ecs/blob/master/use-cases/filebeat-apache-access.md)
* [Logging](https://github.com/elastic/ecs/blob/master/use-cases/logging.md)
* [Metricbeat](https://github.com/elastic/ecs/blob/master/use-cases/metricbeat.md)


Expand Down
2 changes: 2 additions & 0 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pip
PyYAML
autopep8
2 changes: 1 addition & 1 deletion scripts/use-cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def write_stdout():
link_prefix = "https://github.com/elastic/ecs"

links = ""
for file in os.listdir("./use-cases"):
for file in sorted(os.listdir("./use-cases")):

output = ""

Expand Down