Skip to content

Commit

Permalink
refactor: reformat all files with Prettier 3
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpatiiuk committed Dec 13, 2024
1 parent edd3504 commit 4c55cd0
Show file tree
Hide file tree
Showing 215 changed files with 1,581 additions and 1,589 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ specifyweb/frontend/js_src/node_modules
specifyweb/frontend/testBuild
specifyweb/frontend/static/js
# Prevent *.env files from being included in a container (for security)
*.env
*.env
4 changes: 2 additions & 2 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Fixes #

### Checklist

- [ ] Self-review the PR after opening it to make sure the changes look good
and self-explanatory (or properly documented)
- [ ] Self-review the PR after opening it to make sure the changes look good and
self-explanatory (or properly documented)
- [ ] Add automated tests
- [ ] Add relevant issue to release milestone

Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,25 @@ jobs:
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
Expand All @@ -93,7 +93,7 @@ jobs:
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
Expand All @@ -113,28 +113,28 @@ jobs:
path: /tmp/digests
pattern: digests-*
merge-multiple: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ venv/
ve/
seed-database
*.env

/specifyweb/settings/local_settings.py
/specifyweb/settings/local_specify_settings.py
/specifyweb/settings/local_logging_settings.py
/specifyweb/settings/debug.py
/specifyweb/settings/secret_key.py
/specifyweb/settings/ldap_settings.py



# Build artifacts:
/.mypy_cache
/specifyweb/frontend/locale/**/*.mo
/specifyweb/settings/build_version.py
Expand Down
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ repos:
- id: mypy
name: mypy
description: Python mypy typechecker
entry: /bin/bash -c "docker exec --tty specify7_specify7_1 bash -c 'VIRTUAL_ENV=./ve make typecheck'"
entry:
/bin/bash -c "docker exec --tty specify7_specify7_1 bash -c
'VIRTUAL_ENV=./ve make typecheck'"
language: script
types: [python]
pass_filenames: false
Expand Down Expand Up @@ -115,7 +117,7 @@ repos:
- id: prettier
additional_dependencies:
- [email protected]
- "@prettier/plugin-xml@^0.13.1"
- '@prettier/plugin-xml@^0.13.1'
- prettier-plugin-package@^1.3.0
- prettier-plugin-sh@^0.8.1
- prettier-plugin-tailwind-css@^1.5.0
Expand Down
6 changes: 3 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cff-version: 1.2.0
message: "If you use this software in your research, please cite it as:"
message: 'If you use this software in your research, please cite it as:'
authors:
- name: Specify Collections Consortium & Contributors
email: [email protected]
Expand All @@ -9,11 +9,11 @@ keywords:
- open source
identifiers:
- type: url
value: "https://www.specifysoftware.org/"
value: 'https://www.specifysoftware.org/'
description: Specify Collections Consortium
abstract: >-
The Specify Collections Consortium research repositories produce software
platforms that process species and specimen data.
license: GPL-2.0-only
repository-code: specify/specify7
repository: "https://github.com/specify/specify7"
repository: 'https://github.com/specify/specify7'
81 changes: 39 additions & 42 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,25 @@ together to achieve our mission._

## Getting Started

Preferred way to do Specify 7 development is though our development
composition.
Preferred way to do Specify 7 development is though our development composition.

[Documentation for getting development Docker composition
working](https://github.com/specify/specify7/wiki/Docker-Workflow-for-Development)
[Documentation for getting development Docker composition working](https://github.com/specify/specify7/wiki/Docker-Workflow-for-Development)

## Issue Tracking

All feature requests and bugs are tracked on GitHub. Each issue is sorted into a
project. Each project represents a major Specify 7
component. [A list of all projects](https://github.com/specify/specify7/projects?type=classic)
project. Each project represents a major Specify 7 component.
[A list of all projects](https://github.com/specify/specify7/projects?type=classic)

If you found a bug, feel free to open a GitHub issue. Similarly, if you are
interested in fixing some issue or adding new feature, feel free to do so!
If you want to work on a larger feature, it would be best if you [get in touch
with us](mailto:[email protected]) first so that we can make sure the
process is smooth and efficient.
interested in fixing some issue or adding new feature, feel free to do so! If
you want to work on a larger feature, it would be best if you
[get in touch with us](mailto:[email protected]) first so that we can
make sure the process is smooth and efficient.

Our entire workflow for reporting bugs, trianging them, prioritizing the fixes,
testing them and releasing the
fixes - https://github.com/specify/specify7/wiki/Issue-Workflow
testing them and releasing the fixes -
https://github.com/specify/specify7/wiki/Issue-Workflow

You don't have to read every part of that document, but some of the sections in
that document would be relevant
Expand All @@ -66,12 +64,12 @@ Example workflow:
1. Go through GitHub Projects
2. Find a ticket that you are interested in resolving
3. Fix it in a local fork of Specify 7
4. Open a pull request in Specify 7 repository. In the pull request, mention
the issue you are solving by putting `Fixes #1234` in the description, where
4. Open a pull request in Specify 7 repository. In the pull request, mention the
issue you are solving by putting `Fixes #1234` in the description, where
`1234` is a number of GitHub issue
5. We will review the changes and merge them into next release. You will receive
credit in the release notes!

### First Steps

It's recomended to start with issues that are labled with
Expand All @@ -85,42 +83,42 @@ would prepare you for taking on larger GitHub issues.

On the front-end, we are using TypeScript, React and Tailwind CSS.

Front-end root directory is
in [./specifyweb/frontend/js_src](https://github.com/specify/specify7/tree/testability/specifyweb/frontend/js_src)
Front-end root directory is in
[./specifyweb/frontend/js_src](https://github.com/specify/specify7/tree/testability/specifyweb/frontend/js_src)

Each folder and sub-folder has a README.md file that describes the role of that
directory and provides other meta information.

We have a [video of a full front-end code overview from January 2023 available here](https://drive.google.com/file/d/11TDHSz54EhQ5eQPNyaogHOODO8_8Q9yg/view).
We have a
[video of a full front-end code overview from January 2023 available here](https://drive.google.com/file/d/11TDHSz54EhQ5eQPNyaogHOODO8_8Q9yg/view).

## Back-End

Back-end uses Python and Django. It also works closely with a MySQL/MariaDB
database both though Django ORM and though SQLAlchemy.

Back-end root directory
is [./specifyweb/](https://github.com/specify/specify7/tree/production/specifyweb)
Back-end root directory is
[./specifyweb/](https://github.com/specify/specify7/tree/production/specifyweb)

[We have a video of a full back-end overview from January 2023 available here](https://drive.google.com/file/d/1OW60g99aiPw1Y8uHdCUxZCiVnLbFhObG/view?usp=sharing)

## IDE Setup

No special IDE configuration is required, but some optional plugins would
improve developer
experience - https://github.com/specify/specify7/tree/production/specifyweb/frontend/js_src#js_src
improve developer experience -
https://github.com/specify/specify7/tree/production/specifyweb/frontend/js_src#js_src

That document includes a short list. For a full list,
see https://github.com/specifysystems/code-principles
That document includes a short list. For a full list, see
https://github.com/specifysystems/code-principles

In the browser, you can install React Devtools extension to make debugging React
components easier.

## Code-Style

We prefer functional programming paradigm. In our opinion, perfect code\*
consist
of small and pure functions that have clear unit tests, and can be combined
together to solve a complex task.
consist of small and pure functions that have clear unit tests, and can be
combined together to solve a complex task.

> \*no code is perfect, but you can still strive for it
Expand All @@ -129,8 +127,8 @@ formatting to make code less buggy and more consistent.

Additionally, ESLint goes beyond that to provide close to a thousand of static
analysis checks and quick fixes, all in a name of clear and bug-free code. Our
ESLint configuration is located
in [@maxxxxxdlp/eslint-config-react](https://www.npmjs.com/package/@maxxxxxdlp/eslint-config-react)
ESLint configuration is located in
[@maxxxxxdlp/eslint-config-react](https://www.npmjs.com/package/@maxxxxxdlp/eslint-config-react)

## Test Panel

Expand All @@ -149,22 +147,21 @@ quickly deploy an older version of Specify to compare behavior.

## Support

A great deal of user-facing documentation is available at
our [Discourse forum](https://discourse.specifysoftware.org/). Most of it is
available to users from member institutions only, thus [consider joining the
Specify Software Consortium](https://www.specifysoftware.org/membership-levels/)
A great deal of user-facing documentation is available at our
[Discourse forum](https://discourse.specifysoftware.org/). Most of it is
available to users from member institutions only, thus
[consider joining the Specify Software Consortium](https://www.specifysoftware.org/membership-levels/)
if you are interested in becoming a power user of Specify 7.

Besides the README.md files in most folders in this repository, there is also
some developer facing documentation in
our [GitHub Wiki](https://github.com/specify/specify7/wiki).

If you are stuck and need help, consider emailing our support
at [[email protected]](mailto:[email protected]),
opening a [GitHub issue](https://github.com/specify/specify7/issues/new/choose)
or posting a question on
our [Discourse forum](https://discourse.specifysoftware.org/)
as appropriate.
some developer facing documentation in our
[GitHub Wiki](https://github.com/specify/specify7/wiki).

If you are stuck and need help, consider emailing our support at
[[email protected]](mailto:[email protected]), opening a
[GitHub issue](https://github.com/specify/specify7/issues/new/choose) or posting
a question on our [Discourse forum](https://discourse.specifysoftware.org/) as
appropriate.

| Contact Option | Link |
| --------------- | --------------------------------------------------------------------- |
Expand Down
Loading

0 comments on commit 4c55cd0

Please sign in to comment.