Commit Graph

16 Commits

Author SHA1 Message Date
Nayeon Kim 435b11a9b2
fix: typo in specification_parser (#288)
Signed-off-by: Nayeon Kim <inourbubble2@gmail.com>
2025-01-02 10:23:19 -05:00
Anton Grübel 7a78eed656
chore: add mypy and pytest CI step (#275)
Signed-off-by: gruebel <anton.gruebel@gmail.com>
2024-11-27 12:17:01 -05:00
Anton Grübel df1f62ee7f
chore: add dedicated Python CI + ruff (#274)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

- added a dedicated Python CI workflow
- added ruff for linting (only dependency sorting is enabled for now)
and formatting
- added a couple of missing type hints, enabling mypy comes in a
separate PR

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2024-10-04 10:19:50 -04:00
Justin Abrahms bc2d6dfc63
feat: Inline comment support for spec repos (#261)
## This PR
This should allow someone to mark specifications as done based on inline
comments, rather than having to hand-roll regexes.

### How to test
set this in your `.specrc` (example is for go)

```cfg
[spec]
file_extension=go
inline_comment_prefix=//
```

then edit code by adding lines like:

```
import (
	"errors"
	"fmt"
	"sync"

	"github.com/go-logr/logr"
	"github.com/open-feature/go-sdk/openfeature/internal"
	"golang.org/x/exp/maps"
)

//  spec:5.3.5:If the provider emits an event, the value of the client's provider status MUST be updated accordingly.:end

// spec:5.3.4.3:If the provider's on context changed function terminates
// abnormally, and no other invocations have yet to terminate, associated
// PROVIDER_ERROR handlers MUST run.:end

// evaluationAPI wraps OpenFeature evaluation API functionalities
type evaluationAPI struct {
	defaultProvider FeatureProvider
	namedProviders  map[string]FeatureProvider
```

and run `python /path/to/spec/tools/repo_parser/spec_finder.py
--code-directory .`

then validate those don't show up in the remaining complaints.

Signed-off-by: Justin Abrahms <justin@abrah.ms>
2024-06-06 12:10:12 -04:00
Justin Abrahms 9a80acf637
chore: An image for parsing repo spec compliance. (#254)
```
$ docker build -t specfinder .
$ docker run --mount src=/path/tojava-sdk/,target=/appdir,type=bind -it specfinder \
    spec_finder.py --code-directory /appdir --diff --json-report
```

This will generate `java-report.json` in the java-sdk folder which we
can use for other automation.

The report looks like this:

```json
{
    "extra": [
        "1.1.8",
        "2.4.2",
        "2.4.3",
        "2.4.4",
        "2.4.5",
        "4.1.4"
    ],
    "missing": [
        "1.1.2.4",
        "1.7.1",
        "1.7.2.1",
        "1.7.3",
        "1.7.4",
        "1.7.5",
        "1.7.6",
        "1.7.7",
        "1.7.8",
        "2.4.2.1",
        "2.5.2",
        "3.2.2.3",
        "3.2.2.4",
        "3.2.4.2",
        "4.1.4.1",
        "5.1.5",
        "5.3.4.1",
        "5.3.4.2",
        "5.3.4.3",
        "5.3.5"
    ],
    "different-text": [
        "1.1.3",
        "1.1.6",
        "1.2.2",
        "2.4.1",
        "2.6.1",
        "3.2.3",
        "3.2.4.1"
    ],
    "good": [
        "1.1.1",
        "1.1.2.1",
        "1.1.2.2",
        "1.1.2.3",
        "1.1.4",
        "1.1.5",
        "1.1.7",
        "1.2.1",
        "1.3.1.1",
        "1.3.2.1",
        "1.3.3.1",
        "1.3.4",
        "1.4.1.1",
        "1.4.10",
        "1.4.11",
        "1.4.12",
        "1.4.13",
        "1.4.14",
        "1.4.14.1",
        "1.4.2.1",
        "1.4.3",
        "1.4.4.1",
        "1.4.5",
        "1.4.6",
        "1.4.7",
        "1.4.8",
        "1.4.9",
        "1.5.1",
        "1.6.1",
        "2.1.1",
        "2.2.1",
        "2.2.10",
        "2.2.2.1",
        "2.2.3",
        "2.2.4",
        "2.2.5",
        "2.2.6",
        "2.2.7",
        "2.2.8.1",
        "2.2.9",
        "2.3.1",
        "2.3.2",
        "2.3.3",
        "2.5.1",
        "3.1.1",
        "3.1.2",
        "3.1.3",
        "3.1.4",
        "3.2.1.1",
        "3.2.2.1",
        "3.2.2.2",
        "3.3.1.1",
        "3.3.1.2.1",
        "3.3.1.2.2",
        "3.3.1.2.3",
        "3.3.2.1",
        "4.1.1",
        "4.1.2",
        "4.1.3",
        "4.2.1",
        "4.2.2.1",
        "4.2.2.2",
        "4.2.2.3",
        "4.3.1",
        "4.3.2.1",
        "4.3.3.1",
        "4.3.4",
        "4.3.5",
        "4.3.6",
        "4.3.7",
        "4.3.8",
        "4.3.9.1",
        "4.4.1",
        "4.4.2",
        "4.4.3",
        "4.4.4",
        "4.4.5",
        "4.4.6",
        "4.4.7",
        "4.5.1",
        "4.5.2",
        "4.5.3",
        "5.1.1",
        "5.1.2",
        "5.1.3",
        "5.1.4",
        "5.2.1",
        "5.2.2",
        "5.2.3",
        "5.2.4",
        "5.2.5",
        "5.2.6",
        "5.2.7",
        "5.3.1",
        "5.3.2",
        "5.3.3"
    ]
}
```

---------

Signed-off-by: Justin Abrahms <justin@abrah.ms>
2024-05-09 09:25:34 -04:00
Todd Baert a4ffec3d44
feat: initialization and shutdown (#179)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Weyert de Boer <weyert@gmail.com>
Co-authored-by: Justin Abrahms <justin@abrah.ms>
Co-authored-by: Lukas Reining <lukas.reining@codecentric.de>
Co-authored-by: Jonathan Norris <jonathan@taplytics.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Co-authored-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
2023-05-08 16:13:36 -04:00
Todd Baert 636756e700
Fix lint issue, fix linter python script 2022-06-01 14:02:53 -04:00
Justin Abrahms e86a4a626a
Linting to ensure we don't have duplicated numbers 2022-05-29 19:36:56 -07:00
Justin Abrahms 2cb3637cdb
Move all generated spec files to a single file
Also correct the numbering in hooks.md so there were no duplicates.
2022-05-29 19:25:13 -07:00
Justin Abrahms 59c15ddb47
Fix parser whereby there were trailing arrows and no spaces around newlines 2022-05-27 17:04:17 -07:00
Justin Abrahms 84918e20ac
Everything passes lint now. 2022-05-27 16:52:44 -07:00
Daniel Dyla e89936c7cd
parser: add support for .specignore file 2022-05-06 11:10:50 -04:00
Justin Abrahms 4a0d4f4de9
New parser for requirements (#52)
* Update the parser to be aware of markdown hierarchy

* Differentiate between requirements and conditions
2022-05-05 11:45:05 -04:00
Justin Abrahms ece648fec0 Support for missing keywords and condition entries 2022-05-04 15:54:24 -07:00
Justin Abrahms 8b26dc9a93 Add a linter which complains if things don't have a relevant RFC 2119 keyword 2022-05-04 15:54:06 -07:00
Todd Baert 3041ae80d8
Adding spec tooling
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2022-04-21 12:02:28 -04:00