Skip to content

Commit

Permalink
Script Cleanup (#4780)
Browse files Browse the repository at this point in the history
* Clean up test scripts
* Generation script clean-up
* Made flake job rather than pycodestyle build step
* Less aggressive install strategy
* Added action for markdown lint
* Added .editorconfig action
* Removed .editorconfig JSON rule, added SVG rule
* Added duplicate icon name test - fixes #4786
* Add docstrings to all the tests
* Adds icon tags - fixes #3453
* Removed unnecessary test dependencies
* Removed all existing lint errors
  • Loading branch information
Foggalong authored Sep 26, 2021
1 parent 8f3912a commit d4b1230
Show file tree
Hide file tree
Showing 20 changed files with 575 additions and 339 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
insert_final_newline = false
[*.svg]
indent_size = 1

[*.{py,json}]
indent_size = 4
16 changes: 8 additions & 8 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ include:
Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
professional setting

## Our Responsibilities

Expand Down Expand Up @@ -67,10 +67,10 @@ members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
[version 1.4]. For answers to common questions about this code of conduct, see
the [FAQ].

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
[version1.4]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[faq]: https://www.contributor-covenant.org/faq
27 changes: 14 additions & 13 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
# Contributing to Numix Core

So you want to contribute to the Numix app themes? Great! Make sure that you're doing the following so that we can get your contributions merged in as soon as possible.

## General Process

All contributions, regardless of which bit of the project they're part of, must follow these steps:

1. [Fork](https://help.github.com/articles/fork-a-repo/) our GitHub repository
2. Make your changes and [push them](https://help.github.com/articles/pushing-to-a-remote/) to your fork
1. Remember to write a proper [commit message](https://chris.beams.io/posts/git-commit/)
2. If you're fixing an issue, [close it using keywords](https://help.github.com/articles/closing-issues-via-commit-messages/)
1. Remember to write a proper [commit message](https://chris.beams.io/posts/git-commit/)
2. If you're fixing an issue, [close it using keywords](https://help.github.com/articles/closing-issues-via-commit-messages/)
3. Create a new [pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)
4. Make any changes requested and push again
4. When the pull request is accepted you can delete your fork or [sync it](https://help.github.com/articles/syncing-a-fork/)
5. When the pull request is accepted you can delete your fork or [sync it](https://help.github.com/articles/syncing-a-fork/)

Now you are ready to start again!


## Icons

This section covers what to do when creating a new icon or changing the design for an existing icon. If you're wanting to add a symlink see the section on the data file.

1. Make your icon using [Inkscape](https://inkscape.org/) (free and open source)
1. You must follow our [style guidelines](https://github.com/numixproject/numix-core/wiki/Guidelines)
2. Icons must be saved as an optimised SVG with [these settings](https://github.com/numixproject/numix-core/wiki/Optimise-Options)
3. New icon need an entry in the [data file](https://github.com/numixproject/numix-core/blob/master/.github/CONTRIBUTING.md#data-file)
1. You must follow our [style guidelines](https://github.com/numixproject/numix-core/wiki/Guidelines)
2. Icons must be saved as an optimized SVG with [these settings](https://github.com/numixproject/numix-core/wiki/Optimise-Options)
3. New icon need an entry in the [data file](https://github.com/numixproject/numix-core/blob/master/.github/CONTRIBUTING.md#data-file)
2. Create a different pull request for each (unrelated) change you're submitting
1. Pull requests must contain icons for Circle and Square at minimum
2. Adding icons for other themes such as Shine and uTouch is optional
1. Pull requests must contain icons for Circle and Square at minimum
2. Adding icons for other themes such as Shine and uTouch is optional
3. Include a sample of your icon ([example](https://github.com/numixproject/numix-core/pull/1422)) to make review easier


## Data File

The `data.json` file contains all the information needed for linking the icons to the names needed by different platforms. It has the following structure:
Expand All @@ -54,13 +55,13 @@ The `data.json` file contains all the information needed for linking the icons t
* The `linux` part holds the names from the `Icon=*` line of `*.desktop` files
* the `root` holds the primary entry
* the `symlinks` holds alternative names

If you're making changes to this file in a pull request Travis will run a validation check to make sure you haven't made any errors, but please try and check before pushing to make review as easy as possible.

If you're making changes to this file in a pull request Travis will run a validation check to make sure you haven't made any errors, but please try and check before pushing to make review as easy as possible.

## Code
The scripts used for theme building and validation are written in Python. Similarly to the data file, Travis will run a validation check using [pycodestyle](https://github.com/pycqa/pycodestyle) to make sure the coding style you've used is consistent with that used in the project. If you are working on this part of the project it's recommended that you check your changes using a pycodestyle linter before creating a pull request.

The scripts used for theme building and validation are written in Python. Similarly to the data file, Travis will run a validation check using [pycodestyle](https://github.com/pycqa/pycodestyle) to make sure the coding style you've used is consistent with that used in the project. If you are working on this part of the project it's recommended that you check your changes using a pycodestyle linter before creating a pull request.

### Indentation

Throughout this project we use 4 spaces for JSON and Python files, and generally use 1 space for SVG. If you want to diverge, do it locally (e.g. using [git filters](https://stackoverflow.com/questions/2316677/can-git-automatically-switch-between-spaces-and-tabs#2318063)).
6 changes: 0 additions & 6 deletions .github/workflow-assets/test-requirements.txt

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/markdownlint-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"default": true,
"line-length": false
}
47 changes: 35 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,55 @@ on:
branches: [master]

jobs:
build:
# Checks relating to the linting of files
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6

- uses: actions/cache@v2
- name: Install dependencies
run: pip3 install flake8

- name: Check PEP8 compliance
run: find . -name "*.py" | xargs flake8 $1

- name: Check mdl compliance
uses: articulate/[email protected]
with:
config: .github/workflows/markdownlint-config.json
ignore: LICENSE

- name: Check .editorconfig compliance
uses: editorconfig-checker/action-editorconfig-checker@v1

# Checks relating to the database
check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('./.github/workflow-assets/test-requirements.txt') }}
python-version: 3.6

- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get install -y python3-pip python3-gi gir1.2-gtk-3.0 libgtk-3-dev libgirepository1.0-dev
pip3 install --upgrade --upgrade-strategy eager -r ./.github/workflow-assets/test-requirements.txt
run: pip3 install jsonschema

- name: Test
- name: Check database
run: |
sh ./tests/pycodestyle.sh
python3 ./tests/schema.py
python3 ./tests/db_entry.py
python3 ./tests/icons_entry.py
python3 ./tests/ordered_db.py
python3 ./tests/icon_cache.py
python3 ./tests/duplicates.py
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
__pycache__/*
*.pyc

# Tag Directories
icons/tag.*

# Output Directories
numix-circle.icns/
numix-icon-theme-circle/
Expand Down
12 changes: 6 additions & 6 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble

Expand Down Expand Up @@ -69,7 +69,7 @@ patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.

TERMS AND CONDITIONS
TERMS AND CONDITIONS

0. Definitions.

Expand Down Expand Up @@ -619,7 +619,7 @@ an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

Expand Down
Loading

0 comments on commit d4b1230

Please sign in to comment.