Repository navigation
#3833: porting rules for calendars (java.time, Locale.ROOT, Monday = 1) and LINE SEQUENTIAL files - #3895
Merged
Conversation
…1) and LINE SEQUENTIAL files Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3833 (the "Calendars" and "LINE SEQUENTIAL" bullets).
What changed
gitgalaxy/tools/cobol_to_java/cobol_to_java_port_tickets.py:Calendar rule in
PORTING_RULES, placed before the MainframeClock rule. Dates and times go only throughjava.time(LocalDate / LocalDateTime / LocalTime / DateTimeFormatter) withLocale.ROOT, in ISO chronology. It forbidsCalendar.getInstance(),new GregorianCalendar(),SimpleDateFormatandWeekFields.of(Locale.getDefault()), and gives the reasons: th_TH Buddhist era 2569, ja_JP_JP imperial calendar, US Sunday-first weeks. It states thatFUNCTION DAY-OF-WEEK/ACCEPT ... FROM DAY-OF-WEEKare Monday = 1 ... Sunday = 7, which isDayOfWeek.getValue(), and cites Smaller cultural assumptions: calendars/week start, ETL unpacker cp037+float, LINE SEQUENTIAL, national-use chars § Ñ #3833.LINE SEQUENTIAL rule, conditional. The ticket already lists the program's files: the skeleton's
file_controlsection (engineorganizationper SELECT) reachesfacts.sections.file_control. The newline_sequential_rules(file_control)adds one rule when any SELECT isLINE SEQUENTIAL. The rule names those files, says the RECFM=FB rule does not apply to them, and spells out the format:\n, or\r\nwhen the estate runs on Windows.The RECFM=FB rule stays word for word, since the program may also have plain SEQUENTIAL files. In the ticket Markdown, such a program also gets a
## Files (FILE-CONTROL)table (line, file, ASSIGN, organization, andSEQUENTIAL (default)where the clause is absent).A program with only SEQUENTIAL / INDEXED files gets exactly today's rules and Markdown. The test pins
rules == PORTING_RULES.Tests
tests/cobol_mainframe/test_port_rules_culture.pybuilds tickets with a real scan, refractor and cobol-to-java run, liketest_port_tickets.py:java.time,Locale.ROOT, Monday = 1,DayOfWeek.getValue()and Smaller cultural assumptions: calendars/week start, ETL unpacker cp037+float, LINE SEQUENTIAL, national-use chars § Ñ #3833, and every ticket carries it.CSV-IN, RPT-OUT, keeps the FB rule, and has the Files table in its Markdown.PORTING_RULES, with no LINE SEQUENTIAL wording and no Files table.line_sequential_rules(one file, and none).Not done, and why
core/file_control.pyreadsORGANIZATION IS LINE SEQUENTIALandORGANIZATION LINE SEQUENTIALcorrectly. TheORGANIZATIONkeyword is optional in COBOL, though, andSELECT B ASSIGN TO 'b.txt' LINE SEQUENTIAL.is recorded asSEQUENTIAL: the bare-organization branch seesSEQUENTIALpreceded byLINE. Such a program gets no LINE SEQUENTIAL rule until that is fixed. It needs a follow-up in_one_select, and golden masters may move.culture/platform key would be a separate change.Gates
python tests/tools/pr_gates.py --fastpassed 5/5 (lint, audits, secrets, xray, gauntlet).--only goldenand--only suitepassed as separate runs (219s and 882s). No golden masters, baselines or refraction snapshots moved. After mergingorigin/main, ruff format,ruff_audit --ciandmypy_audit --ciare clean. The brief's set also passes:test_port_rules_culture,test_port_tickets,test_batch_jobs, plustest_regional_optionsandtest_key_collation, which indexPORTING_RULES.🤖 Generated with Claude Code