-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from kurtmckee/release-0.2.0
Release 0.2.0
- Loading branch information
Showing
31 changed files
with
1,284 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/.tox/ | ||
/.pytest_cache/ | ||
/build/ | ||
/dist/ | ||
/venv/ | ||
/.coverage.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
- description: 'Check file headers are correct using Chipshot.' | ||
id: 'check-headers' | ||
name: 'Chipshot - Check headers' | ||
entry: 'chipshot' | ||
language: 'python' | ||
|
||
- description: 'Update file headers, if needed, using Chipshot.' | ||
id: 'update-headers' | ||
name: 'Chipshot - Update headers' | ||
entry: 'chipshot --update' | ||
language: 'python' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: 2 | ||
|
||
build: | ||
os: 'ubuntu-22.04' | ||
tools: | ||
python: '3.12' | ||
|
||
sphinx: | ||
configuration: 'docs/conf.py' | ||
fail_on_warning: true | ||
|
||
python: | ||
install: | ||
- requirements: 'requirements/docs.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
* add CI | ||
* write documentation | ||
* publish to readthedocs | ||
* catch exceptions and report them | ||
* allow configuring different headers for different file types. | ||
this allows for a license for docs and a license for code | ||
* allow file paths (for example, ``scripts/*`` or ``script-without-suffix``) | ||
* allow custom encodings | ||
* detect encodings using ``.editorconfig`` | ||
* ignore files using ``.gitignore`` | ||
* use multiprocessing for faster work | ||
* update how similarity is calculated | ||
(it doesn't consider all words and reports 100% similarity) | ||
* test against major repos |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* The CSS code sample comes from: | ||
* https://www.a11yproject.com/posts/how-to-hide-content/ | ||
* | ||
* The CSS selector comes from: | ||
* https://github.com/pallets/pallets-sphinx-themes/blob/1512b53b/src/pallets_sphinx_themes/themes/pocoo/static/pocoo.css#L486-L498 | ||
*/ | ||
|
||
.visually-hidden > h1:first-child { | ||
clip: rect(0 0 0 0); | ||
clip-path: inset(50%); | ||
height: 1px; | ||
overflow: hidden; | ||
position: absolute; | ||
white-space: nowrap; | ||
width: 1px; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pathlib | ||
import tomllib | ||
|
||
# General configuration | ||
# --------------------- | ||
|
||
# The suffix of source filenames. | ||
source_suffix = ".rst" | ||
|
||
# The main toctree document. | ||
master_doc = "index" | ||
|
||
# General information about the project. | ||
project = "Chipshot" | ||
copyright = "2022-2023 Kurt McKee" | ||
|
||
# Extract the project version. | ||
pyproject_ = pathlib.Path(__file__).parent.parent / "pyproject.toml" | ||
info_ = tomllib.loads(pyproject_.read_text()) | ||
version = release = info_["tool"]["poetry"]["version"] | ||
|
||
# The name of the Pygments (syntax highlighting) style to use. | ||
pygments_style = "sphinx" | ||
|
||
|
||
# HTML theme configuration | ||
# ------------------------ | ||
|
||
html_theme = "alabaster" | ||
html_static_path = [ | ||
"_static", | ||
] | ||
html_theme_options = { | ||
"logo": "logo.png", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
.. rst-class:: visually-hidden | ||
|
||
Welcome to the Chipshot documentation | ||
##################################### | ||
|
||
.. image:: _static/banner.png | ||
:alt: The Chipshot logo, with a soccer ball shooting up and away from the project name. | ||
|
||
Chipshot helps you standardize headers in your source code. | ||
Its aim is to help ensure that all source files have excellent headers | ||
with accurate copyright and license information. | ||
If it can help you achieve your goals, then it will have done its job! | ||
|
||
Example | ||
======= | ||
|
||
Chipshot respects byte order marks, newlines, and document prologues | ||
(like hashbangs and XML declarations) when adding and updating headers. | ||
Its default configuration supports many different file types | ||
so it's easy to get started with a minimal configuration file. | ||
|
||
.. rubric:: ``.chipshot.toml`` | ||
.. code-block:: toml | ||
[chipshot] | ||
template = """ | ||
Copyright 2022-{{ year }} Company Name <[email protected]> | ||
SPDX-License-Identifier: MIT | ||
""" | ||
Headers will be rendered as comments based on the file extension. | ||
|
||
.. rubric:: Python | ||
.. code-block:: python | ||
# Copyright 2022-2023 Company Name <[email protected]> | ||
# SPDX-License-Identifier: MIT | ||
.. rubric:: C | ||
.. code-block:: c | ||
/* | ||
* Copyright 2022-2023 Company Name <[email protected]> | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
Getting Started | ||
=============== | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
tutorial/overview | ||
tutorial/installing | ||
tutorial/configuring | ||
|
||
* Default comment styles gallery | ||
|
||
|
||
How-To Guides | ||
============= | ||
|
||
* How to customize comment styles | ||
* How to integrate Chipshot in your everyday development | ||
|
||
|
||
Reference | ||
========= | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
reference/boms | ||
|
||
* Configuration file format | ||
* Pre-commit hooks | ||
* CLI options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Byte Order Marks (BOMs) | ||
####################### | ||
|
||
Chipshot initially reads all files as binary. | ||
If the first bytes correspond to a known byte order mark (BOM), | ||
Chipshot will decode the file using the encoding scheme indicated by the BOM. | ||
|
||
The encoding associated with the BOM is always respected, | ||
even if Chipshot is configured to expect a different encoding. | ||
If the file cannot be decoded using the BOM-indicated encoding, | ||
Chipshot will not try to use any other encoding. | ||
|
||
If Chipshot updates the file, the BOM will be retained. | ||
|
||
These are the BOMs that Chipshot understands, | ||
and the associated encoding that will be used if a BOM is encountered. | ||
|
||
.. csv-table:: | ||
:header: "BOM characters", "Encoding" | ||
|
||
"``00 00 fe ff``", "UTF-32 (Big Endian)" | ||
"``ff fe 00 00``", "UTF-32 (Little Endian)" | ||
"``fe ff``", "UTF-16 (Big Endian)" | ||
"``ff fe``", "UTF-16 (Little Endian)" | ||
"``ef bb bf``", "UTF-8" |
Oops, something went wrong.