Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed blue formatter from docs an .toml files #198

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
### Bug Fixes

* Fix error in `__author__` introduced by [#156](https://github.com/osl-incubator/scicookie/issues/156) ([67a40af](https://github.com/osl-incubator/scicookie/commit/67a40afba6d0041b226e1c37ff46f252a36f843d))
* Make `black` "yes" and `blue` "no" by default ([#164](https://github.com/osl-incubator/scicookie/issues/164)) ([88048e4](https://github.com/osl-incubator/scicookie/commit/88048e43165c5918f4f5e70e9a5b374f9d5d5cf2))
* Make `black` "yes" default ([#164](https://github.com/osl-incubator/scicookie/issues/164)) ([88048e4](https://github.com/osl-incubator/scicookie/commit/88048e43165c5918f4f5e70e9a5b374f9d5d5cf2))
Vishalk91-4 marked this conversation as resolved.
Show resolved Hide resolved


### Features
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for a Python package.
- Licenses supported: MIT, BSD 3 Clause, ISC License, Apache Software License 2.0, and GPL 3
- Documentation engines: mkdocs, sphinx, jupyter-boook
- Test library: pytest, hypothesis
- Auto format code tool: blue and black
- Auto format code tool: ruff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we support ruff as an auto formatter tool?

- Initial integration with git
- Support to conda (as base environment) and poetry as packaging and dependency management
- Support to pre-commit
Expand Down
23 changes: 6 additions & 17 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ the following way:
```python
> [ ] bandit
[ ] black
[ ] blue
[ ] conda
[ ] coverage
[ ] flake8
Expand Down Expand Up @@ -485,7 +484,7 @@ of coding standards, such as PEP 8 guidelines. It helps us ensure consistency in
our code, saves time by automating the formatting process, reduces errors by
enforcing coding standards, and facilitates collaboration by making it easier
for multiple developers to work on the same code base. In the options of
SciCookie, you will find two choices: *Black* and *Blue*.
SciCookie, you will find: *Black*.

- [**Black**](https://black.readthedocs.io): It is a popular code formatter tool
for Python that automatically formats code to conform to PEP 8 guidelines. It
Expand All @@ -497,22 +496,12 @@ standards.
You can read the [*black documentation*](https://black.readthedocs.io) if you
want to know more about it.

- [**Blue**](https://blue.readthedocs.io/en/latest/): is a slightly less
rigid code formatter than *black*, it contains only a few improvements
that the maintainers have considered. It is hoped that in time it can
be merged with the *black* project. Some differences between *blue*
and *black*: *blue* defaults to single-quoted strings for everything
except docstrings and triple-quoted strings (TQS). *blue* defaults to
79-character line lengths, preserving whitespace before the pad for
right-justified comments. It also supports multiple configuration
files: `pyproject.toml`, `setup.cfg`, `tox.ini` and `.blue`.

If you select both *Blue* and *Black* libraries in the TUI (Terminal User
Interface), you will see the following message: "The libs Blue and Black were
selected, but you need to choose just one of them." and the template generation
If you select *Black* libraries in the TUI (Terminal User
Interface), you will see the following message: "The libs Black were
selected." and the template generation
process will be stopped.

Using code formatters such as *Black* or *Blue* in your project helps ensure
Using code formatters such as *Black* in your project helps ensure
consistent and readable code, making it easier to maintain and collaborate on.

### Code security vulnerabilities
Expand Down Expand Up @@ -705,7 +694,7 @@ It is a code quality control tool that runs automatically before commits
are made to a version control repository. When a commit is made,
pre-commit executes the configured hooks. If you select the pre-commit
option offered by SciCookie, we have configured the following hooks for
you: *end-of-file-fixer*, *blue*, *black*, *flake8*, *ruff*, *isort*,
you: *end-of-file-fixer*, *black*, *flake8*, *ruff*, *isort*,
*mypy*, *shellcheck*, *bandit*, *pydocstyle*, *vulture* and *mccabe*
(will be available in your project according to the tools you have
selected in TUI).
Expand Down
1 change: 0 additions & 1 deletion src/scicookie/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
],
"use_bandit": "no",
"use_black": "yes",
"use_blue": "no",
"use_conda": "yes",
"use_makim": "yes",
"use_make": "no",
Expand Down
5 changes: 2 additions & 3 deletions src/scicookie/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
PACKAGE_PATH = PROJECT_DIRECTORY / "{{ cookiecutter.package_slug}}"

USE_BLACK = {{ cookiecutter.use_black == "yes" }}
USE_BLUE = {{ cookiecutter.use_blue == "yes" }}
USE_BANDIT = {{ cookiecutter.use_bandit == "yes" }}
USE_CONTAINERS = {{ cookiecutter.use_containers in ['Docker', 'Podman'] }}
USE_CLI = {{ cookiecutter.command_line_interface != "None" }}
Expand Down Expand Up @@ -259,9 +258,9 @@ def http2ssh(url):


def validation():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check if this function is being called anywhere and remove all those occurences

if USE_BLUE and USE_BLACK:
if USE_BLACK:
raise Exception(
"The libs Blue and Black were selected, but you need to choose "
"The libs Black were selected, but you need to choose "
"just one of them."
)
Vishalk91-4 marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
103 changes: 51 additions & 52 deletions src/scicookie/profiles/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ project_license:
default: BSD 3 Clause
# first choice is the default for the UI
choices:
- BSD 3 Clause
- MIT
- ISC license
- Apache Software License 2.0
- GNU General Public License v3
- Other
- BSD 3 Clause
- MIT
- ISC license
- Apache Software License 2.0
- GNU General Public License v3
- Other
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
visible: true

project_layout:
Expand All @@ -76,8 +76,8 @@ project_layout:
default: src
# first choice is the default for the UI
choices:
- src
- flat
- src
- flat
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
visible: false

build_system:
Expand All @@ -87,15 +87,15 @@ build_system:
default: poetry
# first choice is the default for the UI
choices:
- poetry
- flit
- mesonpy
- setuptools
- pdm
- hatch
- maturin
- scikit-build-core
- pybind11
- poetry
- flit
- mesonpy
- setuptools
- pdm
- hatch
- maturin
- scikit-build-core
- pybind11
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
visible: false

command_line_interface:
Expand All @@ -105,9 +105,9 @@ command_line_interface:
default: None
# first choice is the default for the UI
choices:
- None
- Click
- Argparse
- None
- Click
- Argparse
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
visible: false

documentation_engine:
Expand All @@ -117,9 +117,9 @@ documentation_engine:
default: mkdocs
# first choice is the default for the UI
choices:
- mkdocs
- sphinx
- jupyter-book
- mkdocs
- sphinx
- jupyter-book
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
visible: false

documentation_url:
Expand All @@ -134,24 +134,23 @@ use_tools:
help: "For more information, check:\n https://osl-incubator.github.io/scicookie/guide.html#project-tools"
type: multiple-choices
choices:
- bandit
- black
- blue
- conda
- coverage
- flake8
- ruff
- isort
- make
- makim
- mccabe
- mypy
- pre-commit
- pydocstyle
- pytest
- hypothesis
- shellcheck
- vulture
- bandit
- black
- conda
- coverage
- flake8
- ruff
- isort
- make
- makim
- mccabe
- mypy
- pre-commit
- pydocstyle
- pytest
- hypothesis
- shellcheck
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
- vulture
visible: false

use_containers:
Expand All @@ -161,9 +160,9 @@ use_containers:
default: None
# first choice is the default for the UI
choices:
- None
- Docker
- Podman
- None
- Docker
- Podman
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
visible: false

# doc_template:
Expand All @@ -178,9 +177,9 @@ code_of_conduct:
default: None
# first choice is the default for the UI
choices:
- None
- contributor-covenant
- citizen-code-of-conduct
- None
- contributor-covenant
- citizen-code-of-conduct
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
visible: true

governance_document:
Expand All @@ -190,9 +189,9 @@ governance_document:
default: None
# first choice is the default for the UI
choices:
- None
- numpy-governance
- sciml-governance
- None
- numpy-governance
- sciml-governance
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
visible: false

roadmap_document:
Expand All @@ -202,8 +201,8 @@ roadmap_document:
default: None
# first choice is the default for the UI
choices:
- None
- pytorch-ignite-roadmap
- None
- pytorch-ignite-roadmap
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
visible: false

git_username:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ repos:
language: system
pass_filenames: no
{# keep this comment #}
{%- if cookiecutter.use_blue == "yes" %}
- id: blue
name: blue
entry: blue
language: system
pass_filenames: true
types:
- python
{% endif -%}
{%- if cookiecutter.use_black == "yes" %}
- id: black
name: black
Expand Down
2 changes: 0 additions & 2 deletions src/scicookie/{{cookiecutter.project_slug}}/.releaserc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{%- if cookiecutter.use_blue -%}
{%- set QUOTE = "'" -%}
{%- elif cookiecutter.use_black -%}
{%- set QUOTE = '\\"' -%}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, this should be if now

{%- else -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ testpaths = [
]
{% endif %}

{%- if cookiecutter.use_blue == "yes" %}
[tool.blue]
line-length = 79
target-version = ["py38"]
force-exclude = '''(?x)(
docs/*
| .*\\.egg-info
)''' # TOML's single-quoted strings do not require escaping backslashes
{% endif %}

{%- if cookiecutter.use_black == "yes" %}
[tool.black]
line-length = 79
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ dependencies = [
{%- if cookiecutter.use_coverage == "yes" -%}
"coverage >= 7.2.7",
{% endif %}
{%- if cookiecutter.use_blue == "yes" -%}
"blue >= 0.9.1",
{% endif %}
{%- if cookiecutter.use_black == "yes" -%}
"black >= 23.3.0",
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ dependencies = [
{%- if cookiecutter.use_coverage == "yes" -%}
"coverage >= 7.2.7",
{% endif %}
{%- if cookiecutter.use_blue == "yes" -%}
"blue >= 0.9.1",
{% endif %}
{%- if cookiecutter.use_black == "yes" -%}
"black >= 23.3.0",
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ dependencies = [
{%- if cookiecutter.use_coverage == "yes" -%}
"coverage>=7.2.7",
{% endif %}
{%- if cookiecutter.use_blue == "yes" -%}
"blue>=0.9.1",
{% endif %}
{%- if cookiecutter.use_black == "yes" -%}
"black>=23.3.0",
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ dependencies = [
{%- if cookiecutter.use_coverage == "yes" -%}
"coverage>=7.2.7",
{% endif %}
{%- if cookiecutter.use_blue == "yes" -%}
"blue>=0.9.1",
{% endif %}
{%- if cookiecutter.use_black == "yes" -%}
"black>=23.3.0",
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ dependencies = [
{%- if cookiecutter.use_coverage == "yes" -%}
"coverage>=7.2.7",
{% endif %}
{%- if cookiecutter.use_blue == "yes" -%}
"blue>=0.9.1",
{% endif %}
{%- if cookiecutter.use_black == "yes" -%}
"black>=23.3.0",
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ hypothesis = "^6.0"
{%- if cookiecutter.use_coverage == "yes" -%}
coverage = "^7.2.7"
{% endif %}
{%- if cookiecutter.use_blue == "yes" -%}
blue = "^0.9.1"
{% endif %}
{%- if cookiecutter.use_black == "yes" -%}
black = "^23.3.0"
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ dependencies = [
{%- if cookiecutter.use_coverage == "yes" -%}
"coverage >= 7.2.7,<8",
{% endif %}
{%- if cookiecutter.use_blue == "yes" -%}
"blue >= 0.9.1,<1",
{% endif %}
{%- if cookiecutter.use_black == "yes" -%}
"black >= 23.3.0,<24",
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ dependencies = [
{%- if cookiecutter.use_coverage == "yes" -%}
"coverage >= 7.2.7",
{% endif %}
{%- if cookiecutter.use_blue == "yes" -%}
"blue >= 0.9.1",
{% endif %}
{%- if cookiecutter.use_black == "yes" -%}
"black >= 23.3.0",
{% endif %}
Expand Down
Loading
Loading