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

Create configuration file option #77

Merged
merged 33 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fa652e2
create yml file
jonhealy1 Mar 22, 2022
13f03e2
change stac_check to stac-check
jonhealy1 Mar 22, 2022
7f72a89
parse config
jonhealy1 Mar 22, 2022
eab08c2
update to stac-check
jonhealy1 Mar 22, 2022
7208a4d
check object ids
jonhealy1 Mar 22, 2022
aee8353
check summaries
jonhealy1 Mar 22, 2022
480e789
add custom config file
jonhealy1 Apr 1, 2022
a53ae19
test config
jonhealy1 Apr 1, 2022
d10b773
update changelog
jonhealy1 Apr 1, 2022
643ba23
comment out publish to pypi actions
jonhealy1 Apr 1, 2022
fd1c68b
change default config file
jonhealy1 Apr 1, 2022
0db3b3a
update url
jonhealy1 Apr 12, 2022
6677087
change default_config
jonhealy1 Apr 12, 2022
82856f4
upudate config files
jonhealy1 Apr 12, 2022
28033cd
update test config
jonhealy1 Apr 12, 2022
b704967
add all conditions
jonhealy1 Apr 12, 2022
6f0754b
update changelog
jonhealy1 Apr 12, 2022
f2e5be4
update changelog
jonhealy1 Apr 12, 2022
3220342
Update stac_check/lint.py
jonhealy1 Apr 12, 2022
ddf0baf
import Optional
jonhealy1 Apr 12, 2022
315ac06
remove pypi actions
jonhealy1 Apr 12, 2022
66fda10
use default config file
jonhealy1 Apr 12, 2022
ba4b6d9
fix condition
jonhealy1 Apr 12, 2022
e7dd3fc
num links, properties optional
jonhealy1 Apr 12, 2022
c179b08
add max liinks test
jonhealy1 Apr 12, 2022
a11a4c1
add max to config
jonhealy1 Apr 12, 2022
828bf73
add max links, properties
jonhealy1 Apr 12, 2022
9714a4f
make parse config a static method
jonhealy1 Apr 12, 2022
32b61d2
add env example
jonhealy1 Apr 12, 2022
ff6f70e
import python dotenv
jonhealy1 Apr 12, 2022
0ab7fa9
get config env file
jonhealy1 Apr 12, 2022
34c1fe5
include config file in setup
jonhealy1 Apr 13, 2022
193377a
fix: use pkg_resources to get default config
gadomski Apr 13, 2022
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
66 changes: 33 additions & 33 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: Publish Python distributions to PyPI
# name: Publish Python distributions to PyPI

on:
push:
branches:
- main
# on:
# push:
# branches:
# - main

jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI and TestPyPI
runs-on: ubuntu-18.04
# jobs:
# build-n-publish:
# name: Build and publish Python distributions to PyPI and TestPyPI
# runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
# steps:
# - uses: actions/checkout@master
# - name: Set up Python 3.8
# uses: actions/setup-python@v1
# with:
# python-version: 3.8

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution to PyPI
# if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
password: ${{ secrets.PYPI_API_TOKEN }}
# - name: Install pypa/build
# run: >-
# python -m
# pip install
# build
# --user
# - name: Build a binary wheel and a source tarball
# run: >-
# python -m
# build
# --sdist
# --wheel
# --outdir dist/
# - name: Publish distribution to PyPI
# # if: startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@v1.4.2
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
68 changes: 34 additions & 34 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
name: Publish Python distributions to PyPI
# name: Publish Python distributions to PyPI

on:
push:
branches:
- dev
# on:
# push:
# branches:
# - dev

jobs:
build-n-publish:
name: Build and publish Python distributions to PyPI and TestPyPI
runs-on: ubuntu-18.04
# jobs:
# build-n-publish:
# name: Build and publish Python distributions to PyPI and TestPyPI
# runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
# steps:
# - uses: actions/checkout@master
# - name: Set up Python 3.8
# uses: actions/setup-python@v1
# with:
# python-version: 3.8

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution to Test PyPI
# if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
# - name: Install pypa/build
# run: >-
# python -m
# pip install
# build
# --user
# - name: Build a binary wheel and a source tarball
# run: >-
# python -m
# build
# --sdist
# --wheel
# --outdir dist/
# - name: Publish distribution to Test PyPI
# # if: startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@v1.4.2
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased] -
### Added
- Option to include a configuration file to ignore selected checks
### Changed
- Change name from stac_check to stac-check in setup for cli

## [v1.1.3] - 2022-03-03
- Fix thumbnail size check

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ or for local development
---
### Usage
```
Usage: stac_check [OPTIONS] FILE
Usage: stac-check [OPTIONS] FILE

Options:
--version Show the version and exit.
Expand All @@ -33,7 +33,7 @@ $ make shell
---
### Examples

``` stac_check https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json --recursive ```
``` stac-check https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json --recursive ```
```
____ ____ __ ___ ___ _ _ ____ ___ __ _
/ ___)(_ _)/ _\ / __)___ / __)/ )( \( __)/ __)( / )
Expand Down Expand Up @@ -68,7 +68,7 @@ Recursive validation error message:
This object has 4 links
```

``` stac_check sample_files/0.9.0/landsat8-sample.json```
``` stac-check sample_files/0.9.0/landsat8-sample.json```

<pre><b>stac-check: STAC spec validaton and linting tool</b>

Expand Down Expand Up @@ -96,7 +96,7 @@ STAC Best Practices:
This object has 4 links
</pre>

``` stac_check sample_files/1.0.0/core-item.json --assets```
``` stac-check sample_files/1.0.0/core-item.json --assets```
<pre>
<b>stac-check: STAC spec validaton and linting tool</b>

Expand Down Expand Up @@ -131,7 +131,7 @@ This object has 4 links



``` stac_check sample_files/1.0.0/core-item-bad-links.json --links --assets```
``` stac-check sample_files/1.0.0/core-item-bad-links.json --links --assets```
<pre>
<b>stac-check: STAC spec validaton and linting tool</b>

Expand Down Expand Up @@ -173,7 +173,7 @@ LINK request errors:
This object has 4 links
</pre>

``` stac_check sample_files/0.9.0/bad-item.json```
``` stac-check sample_files/0.9.0/bad-item.json```
<pre>
<b>stac-check: STAC spec validaton and linting tool</b>

Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name="stac_check",
version=__version__,
description="Linting and validation tool for STAC assets",
url="https://github.com/jonhealy1/stac-check",
url="https://github.com/stac-utils/stac-check",
packages=find_packages(exclude=("tests",)),
include_package_data=True,
install_requires=[
Expand All @@ -20,10 +20,11 @@
"requests>=2.19.1",
"jsonschema>=3.1.2b0",
"pytest",
"stac-validator>=2.4.2"
"stac-validator>=2.4.2",
"PyYAML"
],
entry_points={
'console_scripts': ['stac_check=stac_check.cli:main']
'console_scripts': ['stac-check=stac_check.cli:main']
},
author="Jonathan Healy",
author_email="jonathan.d.healy@gmail.com",
Expand Down
27 changes: 27 additions & 0 deletions stac-check.config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
linting:
# Identifiers should consist of only lowercase characters, numbers, '_', and '-'
searchable_identifiers: true
# Item name '{self.object_id}' should not contain ':' or '/'
percent_encoded: true
# Item file names should match their ids
item_id_file_name: true
# Collections and catalogs should be named collection.json and catalog.json
catalog_id_file_name: true
# A STAC collection should contain a summaries field
check_summaries: true
# Datetime fields should not be set to null
null_datetime: true
gadomski marked this conversation as resolved.
Show resolved Hide resolved
# best practices - check unlocated items to make sure bbox field is not set
check_unlocated: true
# best practices - recommend items have a geometry
check_geometry: true
# check to see if there are too many links
bloated_links: true
# best practices - check for bloated metadata in properties
bloated_metadata: true
jonhealy1 marked this conversation as resolved.
Show resolved Hide resolved
# best practices - ensure thumbnail is a small file size ["png", "jpeg", "jpg", "webp"]
check_thumbnail: true
# best practices - ensure that links in catalogs and collections include a title field
links_title: true
# best practices - ensure that links in catalogs and collections include self link
links_self: true
Loading