Skip to content

Commit

Permalink
Clean up developer instructions to a vanilla Go project
Browse files Browse the repository at this point in the history
  • Loading branch information
FiloSottile committed Jul 4, 2024
1 parent e602a4a commit 109c9cf
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 94 deletions.
1 change: 0 additions & 1 deletion .coveralls.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Vet
run: go vet ./...
- name: Staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...
- name: Test
run: go test -v -race ./...

15 changes: 0 additions & 15 deletions .gitignore

This file was deleted.

48 changes: 0 additions & 48 deletions Makefile

This file was deleted.

26 changes: 1 addition & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ We invite pull requests and issues to help us ensure we are offering comprehensi

## Usage

Install in your `${GOPATH}` using `go get -u github.com/microcosm-cc/bluemonday`
Install using `go get github.com/microcosm-cc/bluemonday`

Then call it:
```go
Expand Down Expand Up @@ -380,30 +380,6 @@ It is not the job of bluemonday to fix your bad HTML, it is merely the job of bl
* Investigate whether devs want to blacklist elements and attributes. This would allow devs to take an existing policy (such as the `bluemonday.UGCPolicy()` ) that encapsulates 90% of what they're looking for but does more than they need, and to remove the extra things they do not want to make it 100% what they want
* Investigate whether devs want a validating HTML mode, in which the HTML elements are not just transformed into a balanced tree (every start tag has a closing tag at the correct depth) but also that elements and character data appear only in their allowed context (i.e. that a `table` element isn't a descendent of a `caption`, that `colgroup`, `thead`, `tbody`, `tfoot` and `tr` are permitted, and that character data is not permitted)

## Development

If you have cloned this repo you will probably need the dependency:

`go get golang.org/x/net/html`

Gophers can use their familiar tools:

`go build`

`go test`

I personally use a Makefile as it spares typing the same args over and over whilst providing consistency for those of us who jump from language to language and enjoy just typing `make` in a project directory and watch magic happen.

`make` will build, vet, test and install the library.

`make clean` will remove the library from a *single* `${GOPATH}/pkg` directory tree

`make test` will run the tests

`make cover` will run the tests and *open a browser window* with the coverage report

`make lint` will run golint (install via `go get github.com/golang/lint/golint`)

## Long term goals

1. Open the code to adversarial peer review similar to the [Attack Review Ground Rules](https://code.google.com/p/owasp-java-html-sanitizer/wiki/AttackReviewGroundRules)
Expand Down

0 comments on commit 109c9cf

Please sign in to comment.