mirror of
https://github.com/ben-grande/qusal.git
synced 2025-08-10 07:00:01 -04:00
Fail
This commit is contained in:
parent
f345ebc8a1
commit
6fb526768f
7 changed files with 73 additions and 35 deletions
23
.github/workflows/main.yaml
vendored
Normal file
23
.github/workflows/main.yaml
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
---
|
||||||
|
name: pre-commit
|
||||||
|
|
||||||
|
# yamllint disable-line rule:truthy
|
||||||
|
on: [pull_request, push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre-commit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-python@v3
|
||||||
|
- uses: pre-commit/action@v3.0.0
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: apt update -y && apt install -y gitlint
|
||||||
|
- name: Gitlint
|
||||||
|
# yamllint disable-line rule:line-length
|
||||||
|
run: gitlint --debug --commits ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
|
2
.gitlint
2
.gitlint
|
@ -14,7 +14,7 @@ ignore-squash-commits=false
|
||||||
fail-without-commits=true
|
fail-without-commits=true
|
||||||
regex-style-search=true
|
regex-style-search=true
|
||||||
debug=false
|
debug=false
|
||||||
contrib=contrib-title-conventional-commits,contrib-body-requires-signed-off-by,contrib-allowed-authors
|
contrib=contrib-title-conventional-commits,contrib-body-requires-signed-off-by
|
||||||
|
|
||||||
[title-max-length]
|
[title-max-length]
|
||||||
line-length=50
|
line-length=50
|
||||||
|
|
|
@ -21,7 +21,6 @@ repos:
|
||||||
- id: gitlint
|
- id: gitlint
|
||||||
name: gitlint
|
name: gitlint
|
||||||
language: python
|
language: python
|
||||||
#additional_dependencies: ["./gitlint-core[trusted-deps]"]
|
|
||||||
entry: gitlint
|
entry: gitlint
|
||||||
args: [--staged, --msg-filename]
|
args: [--staged, --msg-filename]
|
||||||
stages: [commit-msg]
|
stages: [commit-msg]
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Ben Grande <ben.grande.b@gmail.com>
|
|
|
@ -1,20 +1,65 @@
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
* [Respect](#respect)
|
* [Respect](#respect)
|
||||||
|
* [Environment](#environment)
|
||||||
|
* [Requirements](#requirements)
|
||||||
|
* [Lint](#lint)
|
||||||
* [Format](#format)
|
* [Format](#format)
|
||||||
* [File naming](#file-naming)
|
* [File naming](#file-naming)
|
||||||
* [State ID](#state-id)
|
* [State ID](#state-id)
|
||||||
* [Readme](#readme)
|
* [Readme](#readme)
|
||||||
* [Qube naming](#qube-naming)
|
* [Qube preferences](#qube-preferences)
|
||||||
* [Qrexec](#qrexec)
|
* [Qrexec](#qrexec)
|
||||||
|
|
||||||
## Respect
|
## Respect
|
||||||
|
|
||||||
Be respectful towards peers.
|
Be respectful towards peers.
|
||||||
|
|
||||||
|
## Environment
|
||||||
|
|
||||||
|
You will need to setup you development environment before you start
|
||||||
|
contributing. You will need Qubes OS R4 or higher.
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
The following are the packages you need to install:
|
||||||
|
|
||||||
|
General:
|
||||||
|
- git
|
||||||
|
|
||||||
|
For writing:
|
||||||
|
- editorconfig
|
||||||
|
- editorconfig plugin for your editor
|
||||||
|
|
||||||
|
For linting:
|
||||||
|
- pre-commit
|
||||||
|
- gitlint
|
||||||
|
- salt-lint
|
||||||
|
- shellcheck
|
||||||
|
- reuse
|
||||||
|
|
||||||
|
For building RPMs:
|
||||||
|
- dnf
|
||||||
|
- rpm
|
||||||
|
- rpmlint
|
||||||
|
|
||||||
|
### Lint
|
||||||
|
|
||||||
|
Lint before you commit, please... else you will have to fix after the PR has
|
||||||
|
already been sent.
|
||||||
|
|
||||||
|
Install the local hooks:
|
||||||
|
```sh
|
||||||
|
pre-commit install -t pre-commit -t commit-msg
|
||||||
|
```
|
||||||
|
|
||||||
|
To run pre-commit linters:
|
||||||
|
```sh
|
||||||
|
pre-commit run
|
||||||
|
```
|
||||||
|
|
||||||
## Format
|
## Format
|
||||||
|
|
||||||
### File naming
|
### File naming
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
## TOOD: test usability
|
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2016 Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
|
||||||
# SPDX-FileCopyrightText: 2019 Brian C. Duggan <https://gist.github.com/bcduggan>
|
|
||||||
# SPDX-FileCopyrightText: 2023 Gonzalo Bulnes Guilpain <gon.bulnes@fastmail.com>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
admin_available = True
|
|
||||||
try:
|
|
||||||
import qubesadmin
|
|
||||||
import qubesadmin.vm
|
|
||||||
except ImportError:
|
|
||||||
admin_available = False
|
|
||||||
|
|
||||||
|
|
||||||
def __virtual__():
|
|
||||||
return admin_available
|
|
||||||
|
|
||||||
|
|
||||||
def ext_pillar(minion_id, pillar, *args, **kwargs):
|
|
||||||
app = qubesadmin.Qubes()
|
|
||||||
try:
|
|
||||||
vm = app.domains[minion_id]
|
|
||||||
except KeyError:
|
|
||||||
return {}
|
|
||||||
|
|
||||||
return {'qubes': { 'tags': list(vm.tags) } }
|
|
|
@ -26,7 +26,8 @@ spec_gen="./scripts/spec-gen.sh"
|
||||||
"${spec_gen}" "${project}"
|
"${spec_gen}" "${project}"
|
||||||
sudo dnf build-dep "${spec}"
|
sudo dnf build-dep "${spec}"
|
||||||
rpmlint "${spec}"
|
rpmlint "${spec}"
|
||||||
rpmdev-setuptree
|
mkdir -p ~/rpmbuild/BUILD ~/rpmbuild/BUILDROOT ~/rpmbuild/RPMS \
|
||||||
|
~/rpmbuild/SOURCES ~/rpmbuild/SPECS ~/rpmbuild/SRPMS
|
||||||
cp -r "${group}/${project}" ~/rpmbuild/BUILD/"${group}-${project}"
|
cp -r "${group}/${project}" ~/rpmbuild/BUILD/"${group}-${project}"
|
||||||
cp -r "${group}/${project}" ~/rpmbuild/SOURCES/"${group}-${project}"
|
cp -r "${group}/${project}" ~/rpmbuild/SOURCES/"${group}-${project}"
|
||||||
rpmbuild -ba "${spec}"
|
rpmbuild -ba "${spec}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue