Skip to content

Commit

Permalink
Setup pre-commit to GEF-Extras (#91)
Browse files Browse the repository at this point in the history
Replicates GEF's pre-commit policy and apply it.

It also fixes all the minor formatting failures found by the policy.
  • Loading branch information
hugsy authored Aug 9, 2023
1 parent 0a72c1a commit 652e0f2
Show file tree
Hide file tree
Showing 42 changed files with 683 additions and 268 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# These are supported funding model platforms

github: [hugsy,]

20 changes: 11 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ labels: triage
assignees: ''

---
## Bug Report

<!--Your issue will be closed unless you confirm the following (insert `x` in the
brackets if done/agreed):-->
brackets if done/agreed) -->

* [ ] Is your bug specific to GEF (not GDB)? - Try to reproduce it running `gdb -nx`
* [ ] Did you search through the [documentation](https://github.com/hugsy/gef/) first?
* [ ] Did you check [issues](https://github.com/hugsy/gef/issues) (including
* [ ] Is your bug specific to GEF (not GDB)? - Try to reproduce it running `gdb -nx`
* [ ] Did you search through the [documentation](https://github.com/hugsy/gef/) first?
* [ ] Did you check [issues](https://github.com/hugsy/gef/issues) (including
the closed ones) - and the [PR](https://github.com/hugsy/gef/pulls)?


### Step 1: Describe your environment

* Operating System / Distribution:
* Architecture:
* GEF version (including the Python library version) run `version` in GEF.
* Operating System / Distribution:
* Architecture:
* GEF version (including the Python library version) run `version` in GEF.


### Step 2: Describe your problem
Expand All @@ -42,12 +44,12 @@ int main(){ return 0; }
#### Observed Results
* What happened? This could be a description, log output, etc.
* What happened? This could be a description, log output, etc.
#### Expected results
* What did you expect to happen?
* What did you expect to happen?
#### Traces
Expand Down
26 changes: 14 additions & 12 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@

"Tested" indicates that the PR works *and* the unit test (i.e. `make test`) run passes without issue.

* [ ] x86-32
* [ ] x86-64
* [ ] ARM
* [ ] AARCH64
* [ ] MIPS
* [ ] POWERPC
* [ ] SPARC
* [ ] RISC-V
* [ ] x86-32
* [ ] x86-64
* [ ] ARM
* [ ] AARCH64
* [ ] MIPS
* [ ] POWERPC
* [ ] SPARC
* [ ] RISC-V

## Checklist

<!-- N.B.: Your patch won't be reviewed unless fulfilling the following base requirements: -->
<!--- Put an `x` in all the boxes that are complete, or that don't apply -->
- [ ] My code follows the code style of this project.
- [ ] My change includes a change to the documentation, if required.
- [ ] If my change adds new code, [adequate tests](https://hugsy.github.io/gef/testing) have been added.
- [ ] I have read and agree to the [CONTRIBUTING](https://github.com/hugsy/gef/blob/main/.github/CONTRIBUTING.md) document.
* [ ] My code follows the code style of this project.
* [ ] My change includes a change to the documentation, if required.
* [ ] If my change adds new code,
[adequate tests](https://hugsy.github.io/gef/testing) have been added.
* [ ] I have read and agree to the
[CONTRIBUTING](https://github.com/hugsy/gef/blob/main/.github/CONTRIBUTING.md) document.
2 changes: 1 addition & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ closeComment: >
complete description; or create a new issue.
Thank you for your contributions.
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
exemptMilestones: true
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: true
Binary file modified .github/workflows/docs-link-check.yml
Binary file not shown.
30 changes: 30 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Validation

on:
pull_request:


jobs:
pre_commit:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0

docs_link_check:
name: Check URLs in docs
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: checkout
uses: actions/checkout@v2
- name: Check links
uses: lycheeverse/lychee-action@v1.4.1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
args: --exclude-mail --accept=401 --no-progress 'docs/**/*.md'
fail: false
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,3 @@ ENV/
.vscode
.benchmarks
.pytest_cache

22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/pycqa/pylint
rev: v3.0.0a6
hooks:
- id: pylint

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
hooks:
- id: markdownlint-docker
args:
- --config=docs/.markdownlint.yaml
- --ignore=README.md
- --ignore=docs/index.md
- "docs/**/*.md"
39 changes: 24 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,48 @@
## Extra goodies for [`GEF`](https://github.com/hugsy/gef)


This is an open repository of external scripts and structures to be used by [GDB Enhanced Features (GEF)](https://github.com/hugsy/gef). To use those scripts once `gef` is setup, simply clone this repository and update your GEF settings like this:

This is an open repository of external scripts and structures to be used by
[GDB Enhanced Features (GEF)](https://github.com/hugsy/gef). To use those scripts once `gef` is
setup, simply clone this repository and update your GEF settings like this:


## Get Started

Getting started with GEF-Extras couldn't be easier: make sure you have a working GDB and GEF already installed, then run the following command:
Getting started with GEF-Extras couldn't be easier: make sure you have a working GDB and GEF
already installed, then run the following command:

```bash
$ wget -q -O- https://github.com/hugsy/gef/raw/main/scripts/gef-extras.sh | sh
wget -q -O- https://github.com/hugsy/gef/raw/main/scripts/gef-extras.sh | sh
```


## Documentation

## Documentation ##

Just like [GEF](https://hugsy.github.io/gef), GEF-Extras aims to have and keep to-date [a through documentation](https://hugsy.github.io/gef-extras/). Users are recommended to refer to it as it may help them in their attempts to use GEF. In particular, new users should navigate through it (see the [FAQ](https://hugsy.github.io/gef/faq/) for common installation problems), and the problem persists, try to reach out for help on the Discord channel or submit an issue.
Just like [GEF](https://hugsy.github.io/gef), GEF-Extras aims to have and keep to-date
[a through documentation](https://hugsy.github.io/gef-extras/). Users are recommended to refer to
it as it may help them in their attempts to use GEF. In particular, new users should navigate
through it (see the [FAQ](https://hugsy.github.io/gef/faq/) for common installation problems), and
the problem persists, try to reach out for help on the Discord channel or submit an issue.


## Current status ##
## Current status

| Documentation | License | Compatibility | CI Tests (`main`) |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Documentation | License | Compatibility | CI Tests (`main`) |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [![Documentation](https://github.com/hugsy/gef-extras/actions/workflows/generate-docs.yml/badge.svg)](https://github.com/hugsy/gef-extras/actions/workflows/generate-docs.yml) | [![MIT](https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=plastic)](https://github.com/hugsy/gef-extras/blob/main/LICENSE) | [![Python 3](https://img.shields.io/badge/Python-3-green.svg)](https://github.com/hugsy/gef-extras/) | [![CI Test for GEF-Extras](https://github.com/hugsy/gef-extras/actions/workflows/tests.yml/badge.svg)](https://github.com/hugsy/gef-extras/actions/workflows/tests.yml) |


## Contribute ##
## Contribute

To get involved, refer to the [Contribution documentation](https://hugsy.github.io/gef-extras/#contribution) and the [GEF guidelines](https://github.com/hugsy/gef/blob/main/.github/CONTRIBUTING.md) to start.
To get involved, refer to the
[Contribution documentation](https://hugsy.github.io/gef-extras/#contribution) and the
[GEF guidelines](https://github.com/hugsy/gef/blob/main/.github/CONTRIBUTING.md) to start.

## Sponsors ##
## Sponsors

Another way to contribute to keeping the project alive is by sponsoring it! Check out [the sponsoring documentation](https://hugsy.github.io/gef/#sponsors) for details so you can be part of the list of those [awesome sponsors](https://github.com/sponsors/hugsy).
Another way to contribute to keeping the project alive is by sponsoring it! Check out
[the sponsoring documentation](https://hugsy.github.io/gef/#sponsors) for details so you can be
part of the list of those [awesome sponsors](https://github.com/sponsors/hugsy).


## Happy Hacking 🍻 ##
## Happy Hacking 🍻
2 changes: 2 additions & 0 deletions archs/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
## Additional architectures for GEF

Experiements for adding new architectures support for GEF
Loading

0 comments on commit 652e0f2

Please sign in to comment.