diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..edd6079 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,70 @@ +# Continuous integration for the NATO alphabet project. +# +# Purpose: run the pytest suite on Python 3.13 so a change is known to work +# before it is merged (BC-001 objective O3, success criterion 2). +# Triggers: a push to main or to a milestone branch, and every pull request +# that touches source, tests, project configuration or this file. +# Inputs: none. +# Secrets: none. The job reads the repository only. +# Changes: nothing outside the repository. +# Decision: MIL-001 task "Add the CI workflow". +# Host: Gitea Actions (act_runner); the same file runs on GitHub Actions. +# The runner must offer the label ubuntu-latest. + +name: CI + +on: + push: + branches: [main, "mil-*"] + paths: + - "src/**" + - "tests/**" + - "pyproject.toml" + - ".gitea/workflows/ci.yml" + pull_request: + paths: + - "src/**" + - "tests/**" + - "pyproject.toml" + - ".gitea/workflows/ci.yml" + +# A newer run of the same branch makes the older one pointless. +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +env: + PYTHON_VERSION: "3.13" + +jobs: + test: + name: Test on Python 3.13 + permissions: + contents: read + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Check out the repository + uses: actions/checkout@v4.2.2 + + - name: Set up Python + uses: actions/setup-python@v5.6.0 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Create the virtual environment and upgrade pip + run: | + python -m venv .venv + .venv/bin/python -m pip install --upgrade pip + + - name: Install the project with its development tools + run: .venv/bin/python -m pip install -e ".[dev]" + + - name: Check the code style + run: .venv/bin/python -m ruff check . + + - name: Check the types + run: .venv/bin/python -m mypy + + - name: Run the tests + run: .venv/bin/python -m pytest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ec4969e --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +# Byte-compiled and cache files +__pycache__/ +*.py[cod] +.pytest_cache/ +.mypy_cache/ +.ruff_cache/ +.import_linter_cache/ + +# Virtual environments +.venv/ +venv/ +env/ + +# Packaging, build and Doxygen output +build/ +dist/ +*.egg-info/ +.eggs/ + +# Coverage +.coverage +htmlcov/ + +# Secrets and local configuration (personal tokens, never committed) +.env +.env.* +!.env.example + +# Editors and operating system +.idea/ +.vscode/ +.DS_Store +Thumbs.db diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..314e874 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,8 @@ +# yamllint configuration for the repository's YAML files (tool: yamllint). +extends: default +rules: + line-length: + max: 100 + truthy: + check-keys: false + document-start: disable diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..4248036 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,374 @@ +# Doxyfile 1.15.0 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "NATO alphabet" +PROJECT_NUMBER = +PROJECT_BRIEF = "Spell a word with the NATO phonetic alphabet (100 Days of Code, day 26)" +PROJECT_LOGO = +PROJECT_ICON = +OUTPUT_DIRECTORY = build +CREATE_SUBDIRS = NO +CREATE_SUBDIRS_LEVEL = 8 +ALLOW_UNICODE_NAMES = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +JAVADOC_BANNER = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +PYTHON_DOCSTRING = YES +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 4 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = YES +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +OPTIMIZE_OUTPUT_SLICE = NO +EXTENSION_MAPPING = +MARKDOWN_SUPPORT = YES +MARKDOWN_STRICT = YES +TOC_INCLUDE_HEADINGS = 6 +MARKDOWN_ID_STYLE = DOXYGEN +AUTOLINK_SUPPORT = YES +AUTOLINK_IGNORE_WORDS = +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +GROUP_NESTED_COMPOUNDS = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = NO +LOOKUP_CACHE_SIZE = 0 +NUM_PROC_THREADS = 1 +TIMESTAMP = NO +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PACKAGE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +RESOLVE_UNNAMED_PARAMS = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_UNDOC_NAMESPACES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = SYSTEM +HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO +SHOW_HEADERFILE = YES +SHOW_INCLUDE_FILES = YES +SHOW_GROUPED_MEMB_INC = NO +FORCE_LOCAL_INCLUDES = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +CITE_BIB_FILES = +EXTERNAL_TOOL_PATH = +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_IF_INCOMPLETE_DOC = YES +WARN_NO_PARAMDOC = NO +WARN_IF_UNDOC_ENUM_VAL = NO +WARN_LAYOUT_FILE = YES +WARN_AS_ERROR = FAIL_ON_WARNINGS +WARN_FORMAT = "$file:$line: $text" +WARN_LINE_FORMAT = "at line $line of file $file" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = src README.md +INPUT_ENCODING = UTF-8 +INPUT_FILE_ENCODING = +FILE_PATTERNS = *.py *.md +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = README.md +IMPLICIT_DIR_DOCS = YES +FORTRAN_COMMENT_AFTER = 72 +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +CLANG_ASSISTED_PARSING = NO +CLANG_ADD_INC_PATHS = YES +CLANG_OPTIONS = +CLANG_DATABASE_PATH = +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE = AUTO_LIGHT +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_DYNAMIC_MENUS = YES +HTML_DYNAMIC_SECTIONS = NO +HTML_CODE_FOLDING = YES +HTML_COPY_CLIPBOARD = YES +HTML_PROJECT_COOKIE = +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_FEEDURL = +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +SITEMAP_URL = +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = NO +GENERATE_TREEVIEW = YES +PAGE_OUTLINE_PANEL = YES +FULL_SIDEBAR = NO +ENUM_VALUES_PER_LINE = 4 +SHOW_ENUM_VALUES = NO +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +OBFUSCATE_EMAILS = YES +HTML_FORMULA_FORMAT = png +FORMULA_FONTSIZE = 10 +FORMULA_MACROFILE = +USE_MATHJAX = NO +MATHJAX_VERSION = MathJax_2 +MATHJAX_FORMAT = HTML-CSS +MATHJAX_RELPATH = +MATHJAX_EXTENSIONS = +MATHJAX_CODEFILE = +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = +MAKEINDEX_CMD_NAME = makeindex +LATEX_MAKEINDEX_CMD = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4 +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_FILES = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +LATEX_BIB_STYLE = plainnat +LATEX_EMOJI_DIRECTORY = +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +RTF_EXTRA_FILES = +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_SUBDIR = +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_PROGRAMLISTING = YES +XML_NS_MEMB_FILE_SCOPE = NO +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# Configuration options related to Sqlite3 output +#--------------------------------------------------------------------------- +GENERATE_SQLITE3 = NO +SQLITE3_OUTPUT = sqlite3 +SQLITE3_RECREATE_DB = YES +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration options related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +EXTERNAL_PAGES = YES +#--------------------------------------------------------------------------- +# Configuration options related to diagram generator tools +#--------------------------------------------------------------------------- +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_NUM_THREADS = 0 +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +UML_LIMIT_NUM_FIELDS = 10 +UML_MAX_EDGE_LABELS = 10 +DOT_UML_DETAILS = NO +DOT_WRAP_THRESHOLD = 17 +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DIR_GRAPH_MAX_DEPTH = 1 +DOT_IMAGE_FORMAT = png +INTERACTIVE_SVG = NO +DOT_PATH = +DOTFILE_DIRS = +DIA_PATH = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_CFG_FILE = +PLANTUML_INCLUDE_PATH = +PLANTUMLFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +MSCGEN_TOOL = +MSCFILE_DIRS = diff --git a/docs/adr/adr-0001-read-nato-data-with-csv-module.md b/docs/adr/adr-0001-read-nato-data-with-csv-module.md new file mode 100644 index 0000000..cef74f6 --- /dev/null +++ b/docs/adr/adr-0001-read-nato-data-with-csv-module.md @@ -0,0 +1,53 @@ +# ADR-0001 Read the NATO data with the standard library csv module + +## Metadata +| Key | Value | +| --- | --- | +| ID | ADR-0001 | +| CrossReference | [BC-001], [SA-001] | + +## Version History +| Date | Status | Author | Reviewer | Change | Commit | +| --- | --- | --- | --- | --- | --- | +| 2026-10-13 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version, reviewed in RC-006 | pending | + +Allowed Status values: `Proposed`, `Accepted`, `Rejected`, `Deprecated`, `Superseded by ADR-NNNN`. + +--- + +## Context + +The lecture reads the NATO alphabet file into a Pandas DataFrame and builds the dictionary with `iterrows`. The file has 26 rows and two columns. S01 follows the lecture, but S03 wants a repository with no runtime dependencies, and [BC-001] objective O5 and constraint "no runtime dependencies unless needed" say the same. + +Options evaluated: + +1. Pandas, as in the lecture: matches the course, but adds a large runtime dependency for a 26-row table. +2. Polars: smaller than Pandas, still a runtime dependency that the task does not need. +3. The standard library `csv` module: no dependency, and the dictionary comprehension that the assignment teaches works unchanged on the rows of `csv.DictReader`. + +## Decision + +Read the NATO alphabet with the standard library `csv` module (`csv.DictReader`) and build the letter-to-code-word dictionary with a dictionary comprehension. The project declares no runtime dependencies. + +## Consequences + +**Positive:** + +- No runtime dependency to install or keep secure; S03 sees an empty dependency list. +- Faster start and a smaller environment for S02. +- The comprehension taught in the lecture is still used. + +**Negative:** + +- The code differs from the lecture's Pandas code, so S02 comparing line by line sees a difference. +- A later day that needs Pandas has to add it explicitly. + +## Affected Artifacts + +- [BC-001] — meets objective O5 and the constraint on runtime dependencies. +- [SA-001] — resolves the conflict between S01 and S03 listed there. + +--- + +[BC-001]: ../business-case.md +[SA-001]: ../stakeholder-analysis.md diff --git a/docs/adr/adr-0002-skip-analysis-artifacts.md b/docs/adr/adr-0002-skip-analysis-artifacts.md new file mode 100644 index 0000000..9e25e66 --- /dev/null +++ b/docs/adr/adr-0002-skip-analysis-artifacts.md @@ -0,0 +1,50 @@ +# ADR-0002 Skip the optional analysis artifacts + +## Metadata +| Key | Value | +| --- | --- | +| ID | ADR-0002 | +| CrossReference | [BC-001] | + +## Version History +| Date | Status | Author | Reviewer | Change | Commit | +| --- | --- | --- | --- | --- | --- | +| 2026-10-13 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version, reviewed in RC-007 | pending | + +Allowed Status values: `Proposed`, `Accepted`, `Rejected`, `Deprecated`, `Superseded by ADR-NNNN`. + +--- + +## Context + +The journey of the framework offers analysis documents beyond the baseline: KPI definitions, a Business Model Canvas, a BPMN process model and a riskiest-assumption test. The project is a single-evening course exercise with six measurable success criteria already in [BC-001], no commercial model, no business process and no costly belief to test. + +Options evaluated: + +1. Write all four documents: complete, but each needs a review and adds no decision that the Business Case does not already hold. +2. Write only the KPI definitions: the success criteria would be restated in another file. +3. Skip all four and record the reason here. + +## Decision + +Skip the KPI definitions, the Business Model Canvas, the BPMN process model and the riskiest-assumption test. The Business Case's Success Criteria table carries the measures, and the baseline documents (Business Case, Stakeholder Analysis, Project Plan, milestones) are not skipped. + +## Consequences + +**Positive:** + +- Less documentation to keep consistent for a small project. +- The success criteria are stated once, in one place. + +**Negative:** + +- A reader who expects a KPI document finds the measures in the Business Case instead. +- If the project grows (a package published, more users), the skipped documents must be written then. + +## Affected Artifacts + +- [BC-001] — its Success Criteria stay the only definition of the measures. + +--- + +[BC-001]: ../business-case.md diff --git a/docs/artifact-registry.md b/docs/artifact-registry.md index 75393a8..b629482 100644 --- a/docs/artifact-registry.md +++ b/docs/artifact-registry.md @@ -1,59 +1,60 @@ -# Artifact Registry - -This project's artifact state. Types, short names and `CrossReference -Candidates` come from the framework catalog -(`framework/registry/artifact-catalog.md`); this file only records where -each document lives in *this* project and the next version to use. - -Delete rows for types you don't use. Add a row the first time you create a -document of a type. `Primary File` may contain a glob (e.g. -`docs/uc-*/uc.md`); `framework/scripts/find-crossreferences.sh` reads it. - -| Short Name | Artifact Type | Primary File | Next Available Version | -| --- | --- | --- | --- | -| BC | Business Case | docs/business-case.md | 002 | -| SA | Stakeholder Analysis | docs/stakeholder-analysis.md | 002 | -| PP | Project Plan | docs/project-plan.md | 002 | -| MIL | Milestone / Gateway | docs/milestones/*.md | 004 | -| RC | SQA Review Record | docs/sqa/reviews/rc-*.md | 006 | -| TM | Traceability Matrix | docs/sqa/traceability-matrix.md | 002 | - -## Languages - -Set the PO language when the project starts; `project-planning` asks for it -if it is missing. An artifact of a type marked "Written in the PO language" -exists once, in that language, under its normal name (`business-case.md`); the -`artifact` skill ("One file per artifact") has the rule. - -| Setting | Value | -| --- | --- | -| PO language | en | -| PO domain | it | -| High-level register | IT Executive English | -| Technical register | IT Professional English | - -Every artifact of a type marked "Yes" below states its language and domain in -its `Language` and `Domain` Metadata rows; `new-artifact.sh` fills them from -`PO language` and `PO domain`. `Language` is a BCP 47 code (`da`, `en`). -`Domain` is a value from this list; add a row to introduce a domain, so a -reviewer can see at once which professional vocabulary a document uses. - -| Domain | Meaning | -| --- | --- | -| it | Software and IT | -| medical | Healthcare and medical devices | -| construction | Construction and civil engineering | - -| Artifact types | Register | Written in the PO language | -| --- | --- | --- | -| BC, KPI, PP, MIL | IT Executive English | Yes | -| SA, BMC, BPMN, UCD, US, UC, SSD, DM, RA, GOV, DICT | IT Professional English | Yes | -| OC, SD, DCD, ERD, ADR, TM, RC, QC, source code | IT Professional English | No | - -## Notes - -- "Next Available Version" is the zero-padded (3-digit) version to use the - *next* time a new document of that type is created. Increment it only when - a brand-new document is created, not when an existing document's - `## Version History` gets a row. -- `ADR` uses 4 digits (`0001`); `RC` is sequential across all artifact types. +# Artifact Registry + +This project's artifact state. Types, short names and `CrossReference +Candidates` come from the framework catalog +(`framework/registry/artifact-catalog.md`); this file only records where +each document lives in *this* project and the next version to use. + +Delete rows for types you don't use. Add a row the first time you create a +document of a type. `Primary File` may contain a glob (e.g. +`docs/uc-*/uc.md`); `framework/scripts/find-crossreferences.sh` reads it. + +| Short Name | Artifact Type | Primary File | Next Available Version | +| --- | --- | --- | --- | +| BC | Business Case | docs/business-case.md | 002 | +| SA | Stakeholder Analysis | docs/stakeholder-analysis.md | 002 | +| PP | Project Plan | docs/project-plan.md | 002 | +| MIL | Milestone / Gateway | docs/milestones/*.md | 004 | +| RC | SQA Review Record | docs/sqa/reviews/rc-*.md | 006 | +| TM | Traceability Matrix | docs/sqa/traceability-matrix.md | 002 | +| ADR | Architecture Decision Record | docs/adr/adr-NNNN-*.md | 0003 | + +## Languages + +Set the PO language when the project starts; `project-planning` asks for it +if it is missing. An artifact of a type marked "Written in the PO language" +exists once, in that language, under its normal name (`business-case.md`); the +`artifact` skill ("One file per artifact") has the rule. + +| Setting | Value | +| --- | --- | +| PO language | en | +| PO domain | it | +| High-level register | IT Executive English | +| Technical register | IT Professional English | + +Every artifact of a type marked "Yes" below states its language and domain in +its `Language` and `Domain` Metadata rows; `new-artifact.sh` fills them from +`PO language` and `PO domain`. `Language` is a BCP 47 code (`da`, `en`). +`Domain` is a value from this list; add a row to introduce a domain, so a +reviewer can see at once which professional vocabulary a document uses. + +| Domain | Meaning | +| --- | --- | +| it | Software and IT | +| medical | Healthcare and medical devices | +| construction | Construction and civil engineering | + +| Artifact types | Register | Written in the PO language | +| --- | --- | --- | +| BC, KPI, PP, MIL | IT Executive English | Yes | +| SA, BMC, BPMN, UCD, US, UC, SSD, DM, RA, GOV, DICT | IT Professional English | Yes | +| OC, SD, DCD, ERD, ADR, TM, RC, QC, source code | IT Professional English | No | + +## Notes + +- "Next Available Version" is the zero-padded (3-digit) version to use the + *next* time a new document of that type is created. Increment it only when + a brand-new document is created, not when an existing document's + `## Version History` gets a row. +- `ADR` uses 4 digits (`0001`); `RC` is sequential across all artifact types. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7b58c7c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,55 @@ +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "nato-alphabet" +version = "0.1.0" +description = "Console tool that spells a word with the NATO phonetic alphabet (100 Days of Code, day 26)." +readme = "README.md" +requires-python = ">=3.13" +license = "AGPL-3.0-or-later" +license-files = ["LICENSE"] +authors = [{ name = "Jens Tirsvad Nielsen" }] +keywords = ["nato", "phonetic-alphabet", "comprehensions", "100-days-of-code"] +dependencies = [] + +[project.optional-dependencies] +dev = [ + "pytest==9.1.1", + "ruff==0.17.0", + "mypy==2.4.0", + "import-linter==2.15", +] + +[project.scripts] +nato-alphabet = "nato_alphabet.main:main" + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +nato_alphabet = ["data/*.csv"] + +[tool.pytest.ini_options] +testpaths = ["tests"] +pythonpath = ["src"] + +[tool.ruff] +line-length = 88 +src = ["src", "tests"] +extend-exclude = ["framework", ".agents", ".claude"] + +[tool.ruff.lint] +select = ["E", "F", "I", "N", "UP", "B", "D"] + +[tool.ruff.lint.pydocstyle] +convention = "pep257" + +[tool.ruff.lint.per-file-ignores] +"tests/**" = ["D"] + +[tool.mypy] +strict = true +files = ["src", "tests"] +mypy_path = "src" diff --git a/src/nato_alphabet/__init__.py b/src/nato_alphabet/__init__.py new file mode 100644 index 0000000..d823b9a --- /dev/null +++ b/src/nato_alphabet/__init__.py @@ -0,0 +1 @@ +"""@brief Console tool that spells a word with the NATO phonetic alphabet.""" diff --git a/src/nato_alphabet/constants.py b/src/nato_alphabet/constants.py new file mode 100644 index 0000000..296a858 --- /dev/null +++ b/src/nato_alphabet/constants.py @@ -0,0 +1,29 @@ +"""@brief Constants of the NATO alphabet tool. + +Every literal that the program, its messages or its data loading depend on is +defined here once. +""" + +## @brief Name of the package that holds the data file. +DATA_PACKAGE: str = "nato_alphabet" + +## @brief Folder inside the package that holds the data file. +DATA_DIRECTORY: str = "data" + +## @brief Name of the comma-separated values file with the NATO alphabet. +DATA_FILE_NAME: str = "nato_phonetic_alphabet.csv" + +## @brief Header of the column with the letter in the data file. +LETTER_COLUMN: str = "letter" + +## @brief Header of the column with the code word in the data file. +CODE_COLUMN: str = "code" + +## @brief Text shown when the program asks for a word. +PROMPT_TEXT: str = "Enter a word: " + +## @brief Text shown when the word holds a character that is not a letter. +INVALID_INPUT_TEXT: str = "Sorry, only the letters A to Z are allowed. Try again." + +## @brief Text shown before the code words are printed. +RESULT_TEXT: str = "Phonetic code words:" diff --git a/src/nato_alphabet/data/nato_phonetic_alphabet.csv b/src/nato_alphabet/data/nato_phonetic_alphabet.csv new file mode 100644 index 0000000..3d8e6d8 --- /dev/null +++ b/src/nato_alphabet/data/nato_phonetic_alphabet.csv @@ -0,0 +1,27 @@ +letter,code +A,Alfa +B,Bravo +C,Charlie +D,Delta +E,Echo +F,Foxtrot +G,Golf +H,Hotel +I,India +J,Juliet +K,Kilo +L,Lima +M,Mike +N,November +O,Oscar +P,Papa +Q,Quebec +R,Romeo +S,Sierra +T,Tango +U,Uniform +V,Victor +W,Whiskey +X,X-ray +Y,Yankee +Z,Zulu \ No newline at end of file diff --git a/tests/test_package.py b/tests/test_package.py new file mode 100644 index 0000000..0ba0135 --- /dev/null +++ b/tests/test_package.py @@ -0,0 +1,29 @@ +"""Smoke tests of the package skeleton.""" + +from importlib import resources + +from nato_alphabet import constants + +EXPECTED_ROW_COUNT = 26 + + +def test_data_file_exists_in_package() -> None: + data_file = ( + resources.files(constants.DATA_PACKAGE) + / constants.DATA_DIRECTORY + / constants.DATA_FILE_NAME + ) + + assert data_file.is_file() + + +def test_data_file_has_one_row_per_letter() -> None: + data_file = ( + resources.files(constants.DATA_PACKAGE) + / constants.DATA_DIRECTORY + / constants.DATA_FILE_NAME + ) + + lines = data_file.read_text(encoding="utf-8").splitlines() + + assert len(lines) - 1 == EXPECTED_ROW_COUNT