From 5bc563c51fba6e34abe10b371b68cc34bfeab740 Mon Sep 17 00:00:00 2001 From: Sherwin-14 Date: Sat, 21 Sep 2024 12:50:42 +0530 Subject: [PATCH 1/9] First draft with python,jupyter, documentation rules knocked down --- docs/contributing/naming-convention.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/contributing/naming-convention.md diff --git a/docs/contributing/naming-convention.md b/docs/contributing/naming-convention.md new file mode 100644 index 00000000..587768e6 --- /dev/null +++ b/docs/contributing/naming-convention.md @@ -0,0 +1,24 @@ +# Contributing Naming Convention + +## General Guidelines + +1.This document outlines the naming conventions for our project. +2.These conventions are intended to promote consistency and clarity across different components. + +### Specific Conventions + +#### Python Code + + Style: We follow the official Python Enhancement Proposal 8 (PEP8) guidelines for naming conventions. + +#### Jupyter Notebooks + + File Names: File names should start with an underscore (_). Please use underscores instead of hyphens. + +#### Documentation + + + + + + From 67deb38d639f8dc8bf9e354cf8c1cde3a0a39146 Mon Sep 17 00:00:00 2001 From: Sherwin-14 Date: Sat, 21 Sep 2024 14:04:06 +0530 Subject: [PATCH 2/9] Added rules for tests and docs --- CHANGELOG.md | 7 +++++-- docs/contributing/naming-convention.md | 15 +++++++++------ mkdocs.yml | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cab9c40..dd741444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,10 +28,13 @@ - Added example PR links to pull request template ([#756](https://github.com/nsidc/earthaccess/issues/756)) - [**@Sherwin-14**](https://github.com/betolink), + [**@Sherwin-14**](https://github.com/Sherwin-14), [**@mfisher87**](https://github.com/mfisher87) - +- Added Contributing Naming Convention document + ([#532](https://github.com/nsidc/earthaccess/issues/532)) + [**@Sherwin-14**](https://github.com/Sherwin-14), + [**@mfisher87**](https://github.com/mfisher87) ### Fixed diff --git a/docs/contributing/naming-convention.md b/docs/contributing/naming-convention.md index 587768e6..023b3964 100644 --- a/docs/contributing/naming-convention.md +++ b/docs/contributing/naming-convention.md @@ -2,23 +2,26 @@ ## General Guidelines -1.This document outlines the naming conventions for our project. -2.These conventions are intended to promote consistency and clarity across different components. +This document outlines the naming conventions for our project. These conventions are intended to promote consistency and clarity across different components. ### Specific Conventions #### Python Code - Style: We follow the official Python Enhancement Proposal 8 (PEP8) guidelines for naming conventions. + **Style**: We follow the official Python Enhancement Proposal 8 [PEP8]((https://peps.python.org/pep-0008/#package-and-module-names) ) guidelines for naming conventions. #### Jupyter Notebooks - File Names: File names should start with an underscore (_). Please use underscores instead of hyphens. + **File Names**: File names should start with an underscore (_). Please use underscores instead of hyphens. #### Documentation + **Directory and File Names**: Directory and file names should use hyphens (-) instead of underscores. +#### Tests +1. **Test File and Function Names**: Test files and functions should start with `test_`. +2. **Additional Guidelines**: For additional guidelines, please refer to the [pytest documentation](https://docs.pytest.org/en/stable/explanation/goodpractices.html#conventions-for-python-test-discovery). - - +!!! note "Test File Naming Convention" + We do not use the _test.py suffix for test files diff --git a/mkdocs.yml b/mkdocs.yml index 2dd3e761..c025246b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -66,6 +66,7 @@ nav: - "Our meet-ups": "contributing/our-meet-ups.md" - "Maintainers Guide": "contributing/maintainers-guide.md" - "Code of Conduct": "contributing/code-of-conduct.md" + - "Naming Convention": "contributing/naming-convention.md" - "Resources": "resources.md" - USER GUIDE: - "user_guide/index.md" From fde4494aafdda9ac49783c6fc77d16f4ea1f52c6 Mon Sep 17 00:00:00 2001 From: Sherwin-14 Date: Sat, 21 Sep 2024 14:07:02 +0530 Subject: [PATCH 3/9] Fixed the nav name of the file --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index c025246b..b59e714c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -66,7 +66,7 @@ nav: - "Our meet-ups": "contributing/our-meet-ups.md" - "Maintainers Guide": "contributing/maintainers-guide.md" - "Code of Conduct": "contributing/code-of-conduct.md" - - "Naming Convention": "contributing/naming-convention.md" + - "Contributing Naming Convention": "contributing/naming-convention.md" - "Resources": "resources.md" - USER GUIDE: - "user_guide/index.md" From 29e617092112205e3d41cddb4702362d7ddf6650 Mon Sep 17 00:00:00 2001 From: Sherwin Varghese <141290943+Sherwin-14@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:31:13 +0530 Subject: [PATCH 4/9] Update docs/contributing/naming-convention.md removing the official Co-authored-by: Matt Fisher --- docs/contributing/naming-convention.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/naming-convention.md b/docs/contributing/naming-convention.md index 023b3964..1dc2e60f 100644 --- a/docs/contributing/naming-convention.md +++ b/docs/contributing/naming-convention.md @@ -8,7 +8,7 @@ This document outlines the naming conventions for our project. These conventions #### Python Code - **Style**: We follow the official Python Enhancement Proposal 8 [PEP8]((https://peps.python.org/pep-0008/#package-and-module-names) ) guidelines for naming conventions. +* **Style**: We follow Python Enhancement Proposal 8 ([PEP8](https://peps.python.org/pep-0008/#package-and-module-names)) guidelines for naming conventions. #### Jupyter Notebooks From 30bf88054637245964b5f9fde937cee200a869ef Mon Sep 17 00:00:00 2001 From: Sherwin Varghese <141290943+Sherwin-14@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:31:47 +0530 Subject: [PATCH 5/9] Update docs/contributing/naming-convention.md added some necessary chnages Co-authored-by: Matt Fisher --- docs/contributing/naming-convention.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/naming-convention.md b/docs/contributing/naming-convention.md index 1dc2e60f..73fdf01d 100644 --- a/docs/contributing/naming-convention.md +++ b/docs/contributing/naming-convention.md @@ -16,7 +16,7 @@ This document outlines the naming conventions for our project. These conventions #### Documentation - **Directory and File Names**: Directory and file names should use hyphens (-) instead of underscores. +* **Directory and file names**: Directory names and Markdown file names should use hyphens (`-`) instead of underscores (`_`). #### Tests From 6770a4a1557a68887137bb815e378a0d0b532abc Mon Sep 17 00:00:00 2001 From: Sherwin Varghese <141290943+Sherwin-14@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:32:26 +0530 Subject: [PATCH 6/9] Update docs/contributing/naming-convention.md for note Co-authored-by: Matt Fisher --- docs/contributing/naming-convention.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/contributing/naming-convention.md b/docs/contributing/naming-convention.md index 73fdf01d..318c67be 100644 --- a/docs/contributing/naming-convention.md +++ b/docs/contributing/naming-convention.md @@ -22,6 +22,3 @@ This document outlines the naming conventions for our project. These conventions 1. **Test File and Function Names**: Test files and functions should start with `test_`. 2. **Additional Guidelines**: For additional guidelines, please refer to the [pytest documentation](https://docs.pytest.org/en/stable/explanation/goodpractices.html#conventions-for-python-test-discovery). - -!!! note "Test File Naming Convention" - We do not use the _test.py suffix for test files From fcc34fb3df4ba55cb9e1faec169cd2fb727715b0 Mon Sep 17 00:00:00 2001 From: Sherwin Varghese <141290943+Sherwin-14@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:32:50 +0530 Subject: [PATCH 7/9] Update mkdocs.yml with the right name Co-authored-by: Matt Fisher --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index b59e714c..c7655fff 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -66,7 +66,7 @@ nav: - "Our meet-ups": "contributing/our-meet-ups.md" - "Maintainers Guide": "contributing/maintainers-guide.md" - "Code of Conduct": "contributing/code-of-conduct.md" - - "Contributing Naming Convention": "contributing/naming-convention.md" + - "Contributing naming convention": "contributing/naming-convention.md" - "Resources": "resources.md" - USER GUIDE: - "user_guide/index.md" From b4ee6b880d06bcb6fc9b3be0ac0469049b522d2e Mon Sep 17 00:00:00 2001 From: Sherwin Varghese <141290943+Sherwin-14@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:58:12 +0530 Subject: [PATCH 8/9] Update docs/contributing/naming-convention.md fixing the mistake of starting with underscores Co-authored-by: Matt Fisher --- docs/contributing/naming-convention.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/naming-convention.md b/docs/contributing/naming-convention.md index 318c67be..aaf86fbc 100644 --- a/docs/contributing/naming-convention.md +++ b/docs/contributing/naming-convention.md @@ -12,7 +12,7 @@ This document outlines the naming conventions for our project. These conventions #### Jupyter Notebooks - **File Names**: File names should start with an underscore (_). Please use underscores instead of hyphens. +* **File names**: Please use underscores (`_`) instead of hyphens (`-`). #### Documentation From 409c8d45d3207a560cf5d4fcfec74784b8fd9594 Mon Sep 17 00:00:00 2001 From: Sherwin Varghese <141290943+Sherwin-14@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:59:21 +0530 Subject: [PATCH 9/9] Update docs/contributing/naming-convention.md with fixing note position Co-authored-by: Matt Fisher --- docs/contributing/naming-convention.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/contributing/naming-convention.md b/docs/contributing/naming-convention.md index aaf86fbc..8cf37711 100644 --- a/docs/contributing/naming-convention.md +++ b/docs/contributing/naming-convention.md @@ -20,5 +20,9 @@ This document outlines the naming conventions for our project. These conventions #### Tests -1. **Test File and Function Names**: Test files and functions should start with `test_`. +1. **Test file and member names**: Test files and methods should start with `test_`. Classes should start with `Test`. + + !!! note "Test File Naming Convention" + We do not use the _test.py suffix for test files + 2. **Additional Guidelines**: For additional guidelines, please refer to the [pytest documentation](https://docs.pytest.org/en/stable/explanation/goodpractices.html#conventions-for-python-test-discovery).