Repository navigation
Commit 94547bd
fix(tm3): end the umask mask at the expression end and read umask values by base
Review follow-ups for the TM3 umask patterns:
- mode/permission: `//` no longer ends the masked expression, because
in Python it is floor division (`0o666 & ~current_umask // 512` is
0o666). The end of a line, also after a # comment, ends it only when
the next line does not start with an operator, `and` or `or`, so a
call continued with `| 0o666` on the next line is reported. The
comment is matched up to 240 characters to keep the check linear; a
longer one is reported as before. A CRLF line ending is accepted the
same way as LF, so `mode = 0o666 & ~umask` in a CRLF file is no
longer reported.
- umask(...) call: the read-and-restore exemption skips spaces, tabs,
line breaks and opening parentheses back to the `=`, so
`old = os.umask(0)` and `old = (os.umask(0))` behave like
`old = os.umask(0)`. `==`, `!=`, `<=` and `>=` are comparisons and
are still reported.
- umask values: outside shell files a number is octal only with a 0o
prefix or a leading 0. A bare number is decimal, so `umask = 14`
(0o016) is not reported and `umask = 8` (0o010) is, in assignments
and calls alike. Shell files and the `umask NNN` command still read
every value as octal.
Signed-off-by: Ilai Goldschmidt <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 3eb3cd9 commit 94547bd
2 files changed
Lines changed: 145 additions & 10 deletions
File tree
- src/skillspector/nodes/analyzers
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
344 | 367 | | |
345 | 368 | | |
346 | 369 | | |
| |||
356 | 379 | | |
357 | 380 | | |
358 | 381 | | |
359 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
360 | 387 | | |
361 | 388 | | |
362 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
363 | 392 | | |
364 | 393 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
| 394 | + | |
| 395 | + | |
372 | 396 | | |
373 | 397 | | |
374 | 398 | | |
| |||
393 | 417 | | |
394 | 418 | | |
395 | 419 | | |
| 420 | + | |
396 | 421 | | |
397 | 422 | | |
398 | 423 | | |
| |||
4048 | 4073 | | |
4049 | 4074 | | |
4050 | 4075 | | |
| 4076 | + | |
| 4077 | + | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
4051 | 4091 | | |
4052 | 4092 | | |
4053 | 4093 | | |
| |||
4148 | 4188 | | |
4149 | 4189 | | |
4150 | 4190 | | |
4151 | | - | |
| 4191 | + | |
4152 | 4192 | | |
4153 | 4193 | | |
4154 | 4194 | | |
4155 | 4195 | | |
4156 | 4196 | | |
| 4197 | + | |
4157 | 4198 | | |
| 4199 | + | |
| 4200 | + | |
4158 | 4201 | | |
4159 | 4202 | | |
4160 | 4203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1826 | 1826 | | |
1827 | 1827 | | |
1828 | 1828 | | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
1829 | 1875 | | |
1830 | 1876 | | |
1831 | 1877 | | |
| |||
1866 | 1912 | | |
1867 | 1913 | | |
1868 | 1914 | | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
1869 | 1952 | | |
1870 | 1953 | | |
1871 | 1954 | | |
| |||
1885 | 1968 | | |
1886 | 1969 | | |
1887 | 1970 | | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
1888 | 1980 | | |
1889 | 1981 | | |
1890 | 1982 | | |
| |||
0 commit comments